parse a line into fields

Robert Brenstein rjb at robelko.com
Fri Aug 26 10:43:36 EDT 2005


>Quoting Ken Ray <kray at sonsothunder.com>:
>
>Hi Eric and Ken (and other of course)
>
>>>have blank spaces in it (not in amongst the squares)
>
>Here is a gif of the field
>http://www.armbase.com/squares.gif
>
>All the best
>Bob


Bob, to make sure what's going on make a button with a following script

put "theNameOfYourField" into f -- insert your field name here
put empty into v
get line (the hilitedlines of fld f) of fld f -- or just get line 1
repeat for each char i in it
   if chartonum(i)<32 then -- control character
     put "[" & chartonum(i) & "]" after v
   else if  chartonum(i)>126 then -- high-ascii
     put "[" & chartonum(i) & slash & i & "]" after v
   else -- normal character
     put i after v
   end if
end repeat
answer v

This will allow you to analyse what you have there in your lines. 
Then you can use 'replace' to get rid of those characters replacing 
each run with a single tab.

Robert



More information about the use-livecode mailing list