parse a line into fields

rev at armbase.com rev at armbase.com
Fri Aug 26 11:31:10 EDT 2005


Quoting Robert Brenstein <rjb at robelko.com>:
Hi there
>
> 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

OK it is now clearer

The lines look like
[0][6]oppn[0][0][0][2]date[0][0][0][3]etc etc

In other words... The data items are not in brackets.

So the data items are chartonum >126

I assume it could be parsed per line by taking only the items without a 
bounding
[]. I could then for example set the item delimiter to ], ignore the 
item if it
starts with [ ?

Would that work?

All the best
bob
>
> 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
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>






More information about the use-livecode mailing list