script puzzle
andu
undo at cloud9.net
Tue Feb 19 01:04:00 EST 2002
Phil Davis wrote:
>
> OK, first my disclaimer: I'm making this all up as I go.
>
> I'm thinkin' the problem is likely this:
> The "line tNum of temp1" phrase forces MC to examine each char in the container, starting at the start, and keep a tally of the line delimiters it finds, until the tally = the target line number. The code asks MC to do this at least once per iteration, and probably 7x (it's used in 7 statements inside the loop). It takes more time to do as the target line number grows greater, because there is a greater number of line delimiters (returns) that have to be found than when it was looking for a lower line number.
>
> If this is the problem, Mr. Yennie's approach (or any similar one) should take care of it. It eliminates line-delimiter counting entirely.
When you use "repeat for each line i in ...", "i" is a constant, you
can't change it (which is why I use an other variable) , but your
reasoning seems to make sense: I tried the suggestion of "the other"
Phil (Philip Chumbley) which does somewhat what you say and the loop
works at a constant pace which makes it about 5 times faster.
Thanks all.
>
> Of course, I could be wrong. ;o)
>
> Phil Davis
>
--
____________________
Regards, Andu Novac
More information about the metacard
mailing list