Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Strings - Special Characters

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Charbile




Joined: 02 Apr 2005
Posts: 106
Location: Blythewood

PostPosted: Sun Oct 11, 2009 2:32 pm    Post subject: Strings - Special Characters Reply with quote

How do you show the forward slash "\" or quotes in strings? Is there an escape character or some way to append it?
Back to top
View user's profile Send private message Visit poster's website
Calehay
...yeah.
Class B Minstrel



Joined: 07 Jul 2004
Posts: 549

PostPosted: Sun Oct 11, 2009 2:41 pm    Post subject: Reply with quote

You can use the append ascii command to do that:

Code:
append ascii (string ID, ascii char #)


Replace "string ID" with ID of the string you want to add it to and replace "ascii char #" with the quotation or \'s ascii number. You'll find that number on the lower left of the Edit Font screen.
_________________
Calehay
Back to top
View user's profile Send private message AIM Address
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Sun Oct 11, 2009 2:59 pm    Post subject: Reply with quote

That is a backslash. This one / is the forward slash.

Anyway, the backslash is the escape character.

For example:

Code:

$0="\"Puppies and Kittens\""
show string(0)


will produce

Quote:
"Puppies and Kittens"


And

Code:

$0="C:\\OHRRPGCE\\"
show string(0)


will produce

Quote:
C:\OHRRPGCE\
Back to top
View user's profile Send private message Send e-mail Visit poster's website
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Mon Oct 12, 2009 7:34 am    Post subject: Reply with quote

Wait, are you saying that the backslash \ is the character used to say "treat my next symbol as an ascii, even if it is supposed to be reserved for something else"? I'm sorry, but I have no clue what "escape" character actually means. After trying to figure out your examples for a few minutes, my quote is the best I could come up with.
_________________
My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161

This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com
Back to top
View user's profile Send private message Visit poster's website
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Mon Oct 12, 2009 9:53 am    Post subject: Reply with quote

Yes, that is a pretty great summary of what an escape character does.


There are a couple special cases where a backslash followed by a certain character can do something magical. In many programming languages, \n gets translated into ASCII 10 which is a newline. \t gets translated into a TAB and there are a few other common ones.

The OHRRPGCE doesn't support any of those magical "escape codes" in strings, but it probably will someday. Right now all the backslash is used for is to "protect" quotes (and other backslashes)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group