Shop OBEX P1 Docs P2 Docs Learn Events
FlexBasic - how to make a string with " inside? — Parallax Forums

FlexBasic - how to make a string with " inside?

pik33pik33 Posts: 2,366
edited 2023-05-31 20:05 in BASIC (for Propeller)

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?

  • evanhevanh Posts: 15,915

    What's wrong with using chr$(34)? There is many non-printables that chr$() is needed for anyway.

  • @evanh said:
    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).

Sign In or Register to comment.