Shop OBEX P1 Docs P2 Docs Learn Events
Escaping the quote in a string — Parallax Forums

Escaping the quote in a string

sebseb Posts: 1
edited 2005-11-29 16:41 in BASIC Stamp
Hi,

is there a way to escape the quote character in a string?

If I do something like

DATA "MY string ""is not over"

I want to have a quote in the string but, doubling it does not.
I tried also with the \ character before.

Does anybody know if it is possible?


Thanks,

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-11-29 06:17
    Hello,

    ·· You must use the ASCII value for the character in your DATA statement as follows:

    DATA "MY string ",·34,"is not over"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-11-29 16:41
    For readability you may want to define a constant like QUOTE to be 34: DATA "My string ", QUOTE,"is not over"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
Sign In or Register to comment.