On Tue, Feb 21, 2012 at 3:52 AM, Kay C Lan <lan.kc.macm...@gmail.com> wrote:

>  repeat for each line L in the keys of yourArray
>       if L > 20 then
>          put L & cr after R
>          if L > 60 then
>                exit repeat
>         end if
>      end if
>  end repeat
>
> Don't waste cyling through lines you don't have to.
>

Agreed, if the keys are sorted. I was assuming that they were coming
straight from the keys of the array (as shown in my example) so you'd have
to test the whole thing. I'd be curious which is faster:

get the keys
sort the keys
do your script

or

get the keys
do my script

My first instinct is to say your solution, for the obvious reasons, but
I've been fooled by the near-infinite speed of repeat for each too many
times to count.
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to