How to put a " into a variable.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How to put a " into a variable.
Hi Guys!
I am trying to put a " into a variable. For example:
put " "test" " into tVar
Any advice will be greatly received!
Thanks,
Googie.
I am trying to put a " into a variable. For example:
put " "test" " into tVar
Any advice will be greatly received!
Thanks,
Googie.
Re: How to put a " into a variable.
Code: Select all
put quote & "test" & quote into tvar
Re: How to put a " into a variable.
Thanks for your reply!
It worked! Although I have another similar question. I have the following string:
"Test String"
I need to remove the " and leave the remaining text only.
Many Thanks for any assistance.
Googie.
It worked! Although I have another similar question. I have the following string:
"Test String"
I need to remove the " and leave the remaining text only.
Many Thanks for any assistance.
Googie.
Re: How to put a " into a variable.
Use replace or replaceText commands.
Look it up in LiveCode's Dictionary or use Google (i.e. search for 'livecode replace command' or some such)
The dictionary should suffice and should always be the first port of call. But it sounds like you may not have tried this...
-
- VIP Livecode Opensource Backer
- Posts: 9732
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: How to put a " into a variable.
What everyone said.
The issue is that "quote" is both a character (") that defines text AND a constant ("quote", ASCII 34) . So in order to be able to add the quote character to a string one must use the constant.
It is easier to understand and use, say, the "return" constant (ASCII 10) when building a multi-line string. One does not hit the return key to do so. But the employment of each is identical.
Craig
The issue is that "quote" is both a character (") that defines text AND a constant ("quote", ASCII 34) . So in order to be able to add the quote character to a string one must use the constant.
It is easier to understand and use, say, the "return" constant (ASCII 10) when building a multi-line string. One does not hit the return key to do so. But the employment of each is identical.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: How to put a " into a variable.
You can also use trueWord:
Code: Select all
put trueword 1 to -1 of tString into tString
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: How to put a " into a variable.
Learn something every day