putting a string containing quotation marks into a variable

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

putting a string containing quotation marks into a variable

Post by magice » Sat Apr 11, 2009 6:17 pm

Here is what I am trying to do. I need to have my user create an html link by entering the url and the clickable text. This is what I have been trying

Code: Select all

 put "<a href="" & tHtmlLink & "">" & tTextToClick & "</a>" into tNewTag
It does not work, I assume, because of the quotation marks in the string

How can I do it?

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm

Post by Bernard » Sat Apr 11, 2009 6:56 pm

try
put "<a href=" & quote & tHtmlLink & quote & ">" & tTextToClick & "</a>" into tNewTag
I think you can also escape quotations with the backslash (but I use the code above and I don't have Rev installed here).

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Post by magice » Sat Apr 11, 2009 8:12 pm

That got it, thank you very much. You guys are the best.

Post Reply