FlexBasic - how to make a string with " inside?
pik33
Posts: 2,387
Standard methods
s$=""""
s$="\""
don't work. Is there any way to do this (except of course s$=chr$(34) ) ?
Comments
The only way I have found is to declare it as a constant, or use the old chr$() trick.
Ah, sorry, that's a funny oversight. I'll make double quotes turn into single quotes (like your first example); I think that's the most common way to do it in BASIC, isn't it?
What's wrong with using chr$(34)? There is many non-printables that chr$() is needed for anyway.
Nothing's wrong with using chr$(34), and people can keep using it if they want to. But that's the only non-control character that couldn't be printed directly, so having an escape mechanism for it makes sense (and matches what FreeBASIC, the inspiration for FlexBASIC, does).