Matchtext for multiple words

J. Landman Gay jacque at hyperactivesw.com
Wed Nov 29 18:07:44 EST 2006


Mark Smith wrote:
> Do you really need to do it with MatchText? Aren't <is in, is among the 
> words of> etc going to work? Or do you really need it to be a one-liner?
> 
> Best,
> 
> Mark
> 
> ps. That's the third one ;-0

Yeah, I noticed that, and I'm not sure how it happened. I only sent one, 
then waited an hour or so. Then I changed the outgoing server I was 
using and sent again. Then three of them showed up. I didn't do it! ;)

Anyway, thanks to Ken, Eric, and yourself for the suggestions. I 
probably didn't explain enough. If I were only checking a single block 
of text then I'd use some of the built-in commands, but I have to loop 
through a couple of zillion blocks. So I figured matchtext would be 
faster if, hopefully, I could issue a single command for each lookup. If 
I have to do multiple lookups for each text block, then I end up with:

if "dinosaur" is in tText and "dog" is in tText and "cat" is in tText

and that would require 3 times the number of lookups over a single 
matchtext. Also, the number of words can vary so I'd have to construct a 
repeat loop to build the command itself, and use a "do" statement to 
execute it -- and both of those are slow. But if I'm wrong, I'd like to 
know. Has anyone done any speed tests on this stuff?

Basically I need the fastest possible way to scan a large number of text 
blocks for an indefinite number of words which occur in any portion of 
the text.

I'll try Ken's thing too -- thanks Ken.

(I'll send this once and cross my fingers.)
-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list