Quotation Marks help
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Quotation Marks help
I'm trying to add the following line to a text file:
<?xml version="1.0" encoding="UTF-8"?>
As you see, there are double quotes in the line. How do I get Revolution to add those quotes?
if I do
put "<?xml version="1.0" encoding="UTF-8"?>" into variable the double quotes cause issues.
I looked at the docs and on the forum, didn't find a solution.
- Noel
<?xml version="1.0" encoding="UTF-8"?>
As you see, there are double quotes in the line. How do I get Revolution to add those quotes?
if I do
put "<?xml version="1.0" encoding="UTF-8"?>" into variable the double quotes cause issues.
I looked at the docs and on the forum, didn't find a solution.
- Noel
Re: Quotation Marks help
try "quote":Nomi wrote:put "<?xml version="1.0" encoding="UTF-8"?>
Code: Select all
put "<?xml version=" & quote & "1.0" & quote & "encoding=" & quote & "UTF-8" & quote & "?>"
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
When doing it that way, I find it's a little less wordy to define:
put quote into q
put "Then he said, "&q&"Howdy, pardner!"&q&" and skipped away..." into msg
Still ugly, but down to just 4 extra characters per quote. There's also the function (gah! its name escapes me!) that will parse in-line variables.
function_name_i_forgot( "So I said, [q]Howdy yerself![q] and ignored him." )
put quote into q
put "Then he said, "&q&"Howdy, pardner!"&q&" and skipped away..." into msg
Still ugly, but down to just 4 extra characters per quote. There's also the function (gah! its name escapes me!) that will parse in-line variables.
function_name_i_forgot( "So I said, [q]Howdy yerself![q] and ignored him." )
~ Nonsanity
~ Chris Innanen
~ Chris Innanen
Ok, tried
put "<?xml version=" & quote & "1.0" & quote & "encoding=" & quote & "UTF-8" & quote & "?>" in URL "file:world_locations.cfg"
Which looks right to me, however when I try to run the program I am receiving the error message:
Handler: can't find handler
Write Config
Line hint is the above line
I'll admit I'm fairly new to Runtime, but everything seems right to me. Any ideas?
- Noel
put "<?xml version=" & quote & "1.0" & quote & "encoding=" & quote & "UTF-8" & quote & "?>" in URL "file:world_locations.cfg"
Which looks right to me, however when I try to run the program I am receiving the error message:
Handler: can't find handler
Write Config
Line hint is the above line
I'll admit I'm fairly new to Runtime, but everything seems right to me. Any ideas?
- Noel
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
I use the q function, from stdLib.rev:
Code: Select all
put "He said, "&q("Hello")&"." -- produces: He said, "Hello".
function q s
return quote&s"e
end q
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn