On Feb 19, 2012, at 10:42 PM, dunb...@aol.com wrote:

> Kay's is much faster than mine.

Don't worry about it, it happens to just about every person who's had 
experience with HyperCard when they come over to LiveCode: the "repeat for 
each" aha! moment: any time you find yourself writing:

repeat with i = 1 to the number of lines|words|items of someContainer

stop. Rewrite it as:

repeat for each line|word|item in someContainer

With the other way, every time in the repeat that you use "chunk i of 
someContainer" you're forcing the engine to count through all the chunks up to 
that one. With "repeat for each" you're not. 

If you need to know which chunk you're on, use an index variable. 
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to