What is the escape char for strings?

BlitzMax Forums/BlitzMax Beginners Area/What is the escape char for strings?

Grey Alien(Posted 2006) [#1]
Hiya, I want to put " in a string but don't know the escape character to put before it. I tried doubling up the quotes (CSV Style) but this doesn't work:

Text[0] = """test"""

I just get:

Compile Error: Expression of type 'String' cannot be invoked

Any ideas? Thanks.


SculptureOfSoul(Posted 2006) [#2]
tilde
~


Grey Alien(Posted 2006) [#3]
Thanks dude.


Grey Alien(Posted 2006) [#4]
Actually I still can't get it to compile:

Text[0] = "~"test"

gives
Compile Error: Bad escape sequence in string. So do I need a hex number after ~ for the " char?


Helios(Posted 2006) [#5]
Text[0] = "~qtest~q"


SculptureOfSoul(Posted 2006) [#6]
Sorry, I forgot that you needed to use a q instead of the quotation marks.

Documentation on all (at least I don't know of any more personally) the escape sequences can be found in Language->Literals.


Grey Alien(Posted 2006) [#7]
Thanks guys, yeah I'm sure it was in the docs somewhere, but where to look evaded me!