On Monday, July 14, 2003, at 03:45 PM, erik hansen wrote:


put (the number of lines in tText) into tTotal
repeat with i = 1 to tTotal
   doSomething(line i of tText)
end repeat

be any faster than:

put 0 into tCounter
repeat for each line of tText
  add 1 to tCounter
  doSomething(line tCounter of tText)
end repeat

It is slightly faster, but it is not the question at hand as I understand it.


I think the situation is this:

put (the number of lines in tText) into tTotal
repeat with i = 1 to tTotal
   doSomething( i, line i of tText )  -- use both # & line
end repeat

is slower than

put 0 into tCounter
repeat for each line tLine of tText
  add 1 to tCounter
  doSomething(tCounter, tLine)  -- use both # & line
end repeat

The first one much climb through the tText every cycle to get to the desired line.

Dar

************************************************************************ ****
Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services
************************************************************************ ****


_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to