Strange results in deletion of lines

David C. davidocoker at gmail.com
Tue May 11 07:26:19 EDT 2010


On Tue, May 11, 2010 at 12:31 AM, Geoff Canyon Rev
<gcanyon+rev at gmail.com> wrote:
>Just in case anyone doesn't realize how different the options are, I
>wrote this code.

Wow!
We can all be assured that I would have never considered such a thing
and will have to play around with your code to understand what you've
done.

>So the filter and repeat for each options run in about a sixtieth of a
>second (remember, they each ran 100 times), while the repeat with i
>=... option takes almost a minute.
>
>The crucial lesson here is avoid expressions like line i of..., but
>only slightly less important is the fact that repeat for each works
>about as fast as filter. If you have a complex operation to perform on
>each line, running multiple filter operations to get it done is likely
>not as efficient as a simple repeat for each loop.

Good info to know. Even better once I learn enough to figure out how
and when to apply different coding strategies.

A very large portion of what I do daily involves text processing of
this general nature and since most of it is of the "one off" nature,
all too often I'm just looking for any kind of solution. When faced
with some very complex processing as I am with this project, my first
objective is just to "make it work" and then if I have the time, try
to figure out how to do it more efficiently if possible. It's obvious
that I need to spend some more time on the efficiency part of the
equation. ;-)

Thanks for the code samples and advice, Geoff

Best regards,
David C.



More information about the use-livecode mailing list