Page 1 of 1
Quotation Marks help
Posted: Fri Apr 18, 2008 9:08 pm
by Nomi
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
Re: Quotation Marks help
Posted: Fri Apr 18, 2008 10:11 pm
by BvG
Nomi wrote:put "<?xml version="1.0" encoding="UTF-8"?>
try "quote":
Code: Select all
put "<?xml version=" & quote & "1.0" & quote & "encoding=" & quote & "UTF-8" & quote & "?>"
Posted: Fri Apr 18, 2008 10:32 pm
by Nonsanity
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." )
Posted: Fri Apr 18, 2008 11:47 pm
by Nomi
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
Posted: Fri Apr 18, 2008 11:51 pm
by Nomi
Nevermind! Solved it. One of those headslap errors.
I used the wording in URL instead of into URL
I love programming!
- Noel
Posted: Sat Apr 19, 2008 3:52 am
by FourthWorld
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