Repeat loop index

Ken Ray kray at sonsothunder.com
Mon Jul 14 18:52:00 EDT 2003


> The "repeat for each" form works on a different assumption:  
> in cases where you know tText won't change during the loop, 
> the engine can afford to keep a pointer into tText that tells 
> it where it left off.  Each time through the loop it only 
> counts forward from where it last left off to the end of the 
> next line, so it scales beautifully:  each iteration takes 
> almost exactly the same time as the last.
> 
> And with specifying a chunk variable in the repeat statement, 
> the chunk is already parsed and stored in that var each 
> iteration, ready for use.

Wouldn't it be great if we had:

  repeat for each line tMyLine in tData with counter tCounter
    doSomething(tMyLine)
  end repeat
  -- Then use tCounter thereafter...

Just a suggestion...

:-)

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 





More information about the use-livecode mailing list