control scructure repeat and next line

Dar Scott dsc at swcp.com
Tue Feb 17 13:59:42 EST 2004


On Tuesday, February 17, 2004, at 11:41 AM, hershrev wrote:

>> repeat for each line L in myList
> So the "L" is a variable that automatically initializes to 1 ?
>>   -- first time through, L contains line 1
>>   doStuff L   -- your script for processing the line
>>   -- next time through the loop, L contains line 2 and so on
>> end repeat

It contains the value of line 1.  That is, line one without any line 
delimiters.

I like to think of it as a constant rather than a variable, a constant 
that is new each time through.

The Revolution style is to put item and line delimiters between datums, 
but it will also accommodate putting them after datums.  This is 
important in representing empty datums.  If datums are never empty, 
then putting delimiters between is fine.  I mention this, in case you 
are surprised about how many lines are processed in such a loop.

Dar Scott



More information about the use-livecode mailing list