Timing (was wordOffset, repeat loop, speed?

Dar Scott dsc at swcp.com
Mon Jan 6 14:29:01 EST 2003


On Monday, January 6, 2003, at 11:58 AM, Mark Brownell wrote:

> 2.) I noticed that it won't work with multiple words or empty space 
> between
> characters. I would like to work with the numericle offset of 
> characters and
> place that info gathered into an array if possible.

Would offset() do what you want?
I would expect this to be faster, since going to the start position 
will have constant time.

(Your method probably has mc^2 time, call it E ;-), where m is the 
number of words to find and c is the length of your string in 
characters.  Using offset() should have mc time.  Why squared?  I'm 
just guessing, but I assume wordOffset() has to count up to the 
starting word each time.)

Dar Scott




More information about the use-livecode mailing list