Putting " inside a string

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
PandaMan94
Posts: 2
Joined: Thu Feb 09, 2012 8:34 pm

Putting " inside a string

Post by PandaMan94 » Thu Feb 09, 2012 8:37 pm

I'm trying to put some text in a field, and I want to have multiple " symbols inside it. But it keeps messing up the string, what can I do to have these inside? Thanks.

Klaus
Posts: 14196
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Putting " inside a string

Post by Klaus » Thu Feb 09, 2012 8:56 pm

Hi Pandaman,

welcome to the forum! :D

You need to "create" the complete text including quotes like this:
...
put "This is" && QUOTE & "text in quotes" & QUOTE into fld "quoted text"
...

-> This is "text in quotes"


Best

Klaus

PandaMan94
Posts: 2
Joined: Thu Feb 09, 2012 8:34 pm

Re: Putting " inside a string

Post by PandaMan94 » Thu Feb 09, 2012 9:30 pm

Thank you !! :D Works perfectly!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: Putting " inside a string

Post by dunbarx » Thu Feb 09, 2012 11:12 pm

What Klaus said,

But do you fully understand that quotes are native parsers for literal strings? They will not appear on their own UNLESS you use the quote constant. Read about it in the dictionary.

So writing: put "xyz" --yields xyz
But: put quote & "xyz" & quote --yields "xyz"

Craig Newman

Post Reply