NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: CaseyR on November 30, 2015, 03:56:30 PM
-
Hi, Bruce
Pretty sure I know that answer to this question but if I am wrong it will save a lot of work and potential bugs so here goes:
Is there a way to take the standard text you might find in a Javascript and double up or replace with ascii numbers all the < { ' characters using StringTheory. Replacing < and { are easy, but I don't see any way to deal with single quotes. For some reason, I thought I saw it in your session on StringTheory on ClarionLive, but couldn't find it when I reviewed the session. Thanks.
-
check out QUOTE in the clarion docs - it might be all you need.
-
Thanks, Kevin. At a loss as why I never noticed it before.
-
Thanks again, Kevin, but the Clarion Language QUOTE does not handle single quotes despite the documentation. QUOTE in the Template Language does though.
QUOTE( ' Test ' < { Characters ' ),0) will yield the same compiler errors as MESSAGE( ' Test ' << {{ ')
Looks like a CODE template for building script strings is in order
-
Correct - to use Quote you need to start with a valid string in the clarion language. Sounds like your code template might have potential.
-
For anyone with the same problem, this code template will take your source text, convert it to a qualified Clarion string and append it to the packet. Watch the line break on first line.
#CODE(ClarionString,'Packet Clarion String from Input'),DESCRIPTION('Packet Clarion String: '&%DescriptionText)
#!Double ups ' { < and appends to packet
#DECLARE(%ModifiedText)
#PROMPT('Text to append:',TEXT),%InputText
#DISPLAY('No start and end quotes')
#PROMPT('Description:',@s255),%DescriptionText
#SET(%ModifiedText,QUOTE(%InputText))
packet.append('%ModifiedText')