AW: Lines, items, repeat loops, > not always what you think

David Burgun dburgun at dsl.pipex.com
Tue Oct 18 11:07:55 EDT 2005


>Hi Jim,
>
>
>>  Cautionary note:  I have gone to a different method of controlling repeat
>>  loops now that I am working with database tables.
>>
>>  (Please note the handlers I have included below to see this 'anomaly' in
>>  action.)
>>
>>  In Xtalk, the number of lines or items depends on the delimiter AND if the
>>  last line/item has anything in it.   Due to this inconsistency, I am now
>>  using a function ... delimCount()+1  as follows
>
>The number of lines or items does not count an additional empty 
>object at the end: "A,B" and "A,B," both have two items.
>I would think this is rather a feature, because I don't have to take 
>care of removing delimiters at the end after creating lists with
>put something & comma after myList

Except if you are using a list field! Then you either have to remove 
them, or check that the selected line is less than or equal to the 
number of lines in the list field.

All the Best
Dave



More information about the use-livecode mailing list