>> Well, you can speed that up by always operating on the first line of 
>> tText, as in:
>> 
>> newString = EMPTY
>> temp = tText
>> repeat with i = 1 to tLines
>>   aLine = temp.line[1]
>>   --modify aLine
>>   put aLine after newString
>>   delete line 1 of temp
>> end repeat
>
>I'm pretty sure that would be slower, since each time you delete from the 
>beginning of a string, 
>everything after it is moved to the fill the data structure from the front.
Nope. 

It's an old-time director trick. With large chunks of text, the "delete 
the first line" trick is _massively_ faster, because director doesn't 
have to parse the text for an index point to the line that you want.

The "put aLine after newString" will be the bottleneck as tText gets 
large. There are ways around that, too, if it's an issue.
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[email protected]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to