"repeat for each" in reverse order ?

Robert Brenstein rjb at robelko.com
Mon Jun 27 03:57:30 EDT 2005


>It sounds like you're looking for a feature that doesn't yet exist 
>(or at least I'm not aware of it). I could see having a property 
>that defines the direction in which the 'repeat for each' structure 
>does its looping, like this:
>
>   set the repeatDirection to "descending" -- or "down", "reverse", ???
>   repeat for each element x in y
>     -- actions
>   end repeat
>
>That would be a nice feature indeed. No harm in requesting it!
>
>Phil Davis

I would prefer

   repeat for each element x in y descending

but I doubt whether this would have the performance anywhere close to 
ascending 'for each' so it is probably pointless to have it. As far 
as I know, the speed of 'repeat for each' comes from processing 
elements sequentially and thus without having to recalculate the list 
pointer position.

Robert



More information about the use-livecode mailing list