I'm doing some HTML conversion and trying to convert all the quote symbol in
HTML into " & quote & ".
For example: I'd want to change the following line
<body background="images/bkg.jpg" topmargin="0" leftmargin="0" marginwidth="0"
marginheight="0">
into
"<body background=" & quote & "images/pic_young_bg.jpg" & quote & "topmargin="
& quote & "0" & quote & " leftmargin=" & quote & "0" & quote & " marginwidth="
& quote & "0" & quote & " marginheight=" & quote & "0" & quote & ">
by a handler.
I have a handler below:
on convertQuote aField
aString = the text of field aField
temp = aString.char.count
if char 1 of field aField <> quote then
theString = char 1 of field aField
else
theString = " & quote & "
end if
repeat with i = 2 to temp
if char i of field aField = quote then
theString = theString & " & quote & "
else
theString = theString & char i of field aField
end if
end repeat
put theString
end
It would conver the example line into:
<body background= & quote & images/pic_young_bg.jpg & quote & topmargin= &
quote & 0 & quote & leftmargin= & quote & 0 & quote & marginwidth= & quote &
0 & quote & marginheight= & quote & 0 & quote & >
It won't add QUOTE symbol into the text. I can copy the result to a field do a
find and replace but would prefer an automatic way.
Is there a way to achieve what I need?
Thanks,
Changhsu Liu
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]