item delimiter

Kee Nethery kee at kagi.com
Tue Jun 4 10:56:01 CDT 2002


>What is the "safest" char to use as an item delimiter when you don't 
>know anything about the text?  I realize that arrays don't have the 
>delimiter delimma, but my question is about lists.  What ascii char 
>is least likely to be used by some foreign language as either a 
>letter or as a punctuation mark?  Can I use one of the codes between 
>0 and 7 or between 14 and 31 as an item delimiter?
>
>
>-- D

If you consider the text as part of a spreadsheet, columns and rows, 
I use ascii(30) "record separator" between columns and I use 
ascii(29) "gs" between rows.

Whatever you chose, if you are creating the file that you intend to 
parse, make sure that you cull the data for your separator value 
before you store it with separators.

ie:

put numtochar(30) into rs
put numtochar(29) into gs
repeat until offset(rs,thetext) = 0
  put space into char offset(rs,thetext) of thetext
end repeat
repeat until offset(gs,thetext) = 0
  put space into char offset(gs,thetext) of thetext
end repeat

... code here to store the text with the separators embedded in it.

Kee Nethery



More information about the use-livecode mailing list