Raised This Month: $ Target: $400
 0% 

Print double quotes?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 10-30-2008 , 08:09   Print double quotes?
Reply With Quote #1

And other escape codes? Tried \" and the compiler got mad at me.

If anybody has the full list of escape codes (assuming AMXX has them), that'd be great.
Ricky Leone is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-30-2008 , 08:51   Re: Print double quotes?
Reply With Quote #2

The defaut character to escape in Pawn is ^

To change it, insert : #define ctrlchar '\'
__________________
Arkshine is offline
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 10-30-2008 , 09:05   Re: Print double quotes?
Reply With Quote #3

Alright, so to print a double quote, it would be:

Code:
client_print(id, print_chat, "^"%s^" has joined the game.", szName)
Is that right? If there are any differences in the escape codes from C++, I'd appreciate it if you could list them.
Ricky Leone is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-30-2008 , 09:08   Re: Print double quotes?
Reply With Quote #4

That's right. But if you don't like or have to change the control char, use the define as above.
__________________
Arkshine is offline
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 10-30-2008 , 09:56   Re: Print double quotes?
Reply With Quote #5

Ok, so what are the escape codes? O_o
Ricky Leone is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-30-2008 , 10:06   Re: Print double quotes?
Reply With Quote #6

Probably all characters not reserved. But why do you want know that ?
__________________
Arkshine is offline
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 10-30-2008 , 10:15   Re: Print double quotes?
Reply With Quote #7

...Do you even know what I'm talking about?

An example list of escape codes in C++ would be:
Code:
\n - newline
\r - carriage return
\t - tab
\v - vertical tab
\b - backspace
\f - form feed (page feed)
\a - alert (beep)
\' - single quote (')
\" - double quote (")
\? - question mark (?)
\\ - backslash (\)
I'm looking for the Pawn equivalent.
Ricky Leone is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-30-2008 , 10:26   Re: Print double quotes?
Reply With Quote #8

Are 'almost' the same...just replace '\' with default ctrlchar '^' so will be
Code:
^n, ^t, ^"^"
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 10-30-2008 , 10:33   Re: Print double quotes?
Reply With Quote #9

Right, I get that. But I'm asking if all of the same escape codes will work. If not, which ones and are there any unique ones in Pawn?

Thanks for the help.
Ricky Leone is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-30-2008 , 11:26   Re: Print double quotes?
Reply With Quote #10

Sorry I have misread.

In the Pawn Language Reference you can read (p.103) :

Quote:
’\a’ Audible alarm (beep)
’\b’ Backspace
’\e’ Escape
’\f’ Form feed
’\n’ New-line
’\r’ Carriage Return
’\t’ Horizontal tab
’\v’ Vertical tab
’\\’ \ the escape character
’\’’ ’ single quote
’\"’ " double quote
’\% % percent sign
’\ddd;’ character code with decimal code “ddd”
’\xhhh;’ character code with hexadecimal code “hhh”
The semicolon afterthe \ddd; and \xhhh; codes is optional.
Its purpose is to give the escape sequence sequence an explicit termination symbol when it is used in a string constant.
The backslash (“\”) is the default “escape” character. If desired, you can set a di?erent escape character with the #pragma ctrlchar directive (page 121).
Not tested all. Though to escape % you should write %% , n, r, t, ", work for sure. \\ or ^^, too. ( depending the ctrchar defined ).
__________________
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode