string cleaning

Alex Rice alex at mindlube.com
Mon Nov 10 17:52:03 EST 2003


In my revclips external, I pass strings and symbol names to the CLIPS 
system, which is not as flexible as runrev with it's data types. In 
CLIPS a string is:

"""A string is a set of characters that starts with a double quote (") 
and is followed by zero or more printable characters. A string ends 
with double quotes. Double quotes may be embedded within a string by 
placing a backslash (\) in front of the character. A backslash may be 
embedded by placing two consecutive backslash characters in the string. 
Some examples are "foo"          "a and b"       "1 number"      
"a\"quote"  """

I guess the "printable characters" is what's tripping me up. Sometimes 
users will copy-paste in characters that Rev accepts just fine in a 
text field, but CLIPS doesn't think they are OK as a string. I've fixed 
the obvious problem characters like double quote.

CLIPS is an ANSI C program, originating probably in Unix or even 
PDP/microcomputer days. Can anyone make a guess as to what printable 
characters means in that context and a good transcript method to clean 
strings for sending to CLIPS? Thanks,

Alex Rice <alex at mindlube.com> | Mindlube Software | 
<http://mindlube.com>

what a waste of thumbs that are opposable
to make machines that are disposable  -Ani DiFranco



More information about the use-livecode mailing list