A slightly disturbing problem about items

Dennis Brown see3d at writeme.com
Sat Jun 4 17:56:08 EDT 2005


I've finally determined that item delimiters come after the item.   
The last item of a list does not have to have a delimiter --it is  
optional if no more characters in the list.  To keep out of trouble,  
and make cleanup of the last delimiter unnecessary, I always keep the  
trailing delimiter in my lists.  Unfortunately, it is always left off  
when a chunk is returned --even if the last item was empty, meaning  
you lose one item (though an empty one).  You can fix this by always  
appending a delimiter to a returned chunk.  However, in the case  
where you ask for more items than the list has, it will keep the  
trailing delimiter.  You must be vigilant to keep the number of items  
correct in a sparse regular array.  It would take a whole tutorial  
just to explain the proper care and feeding of delimiters.

Dennis


On Jun 4, 2005, at 3:15 PM, jbv wrote:

> Example 1 :
>
> on mouseUp
>   put "" into L
>   repeat with i=1 to 5
>     put i & comma after L
>   end repeat
>   put number of items of L
> end mouseUp
>
> the answer is "5"
>
> ---------------
>
> Example 2 :
>
> on mouseUp
>   put "" into L
>   repeat with i=1 to 5
>     put i & comma after L
>   end repeat
>   sort items of L ascending numeric
>   put number of items of L
> end mouseUp
>
> the answer is "6"
>
>
> Any comment ?
>
> JB
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list