a little help with "find" script

Timothy Miller gandalf at doctorTimothyMiller.com
Fri Mar 9 15:28:23 EST 2012


Oops. Forgot how to do this. Knew it once. I don't write scripts every day. Not even every month.

Please remind me how to write a script that finds and records every instance of a string in field "foo" I know how to write repeat loops, but can't remember how to keep finding and then exit when the last instance is found.

It would be helpful to add a user entry to the dictionary about this. If I can do it correctly and coherently, I'll add one myself.

Many cards in this stack contain field "foo" Field foo may contain none, one or many instances of the string I will be looking for.

I will  not necessarily be on card one when I start searching and the cursor may or may not be inserted in field foo. Not all cards contain field foo

Let's put all the foundchunks into tVar. I can take it from there.

After "char x to y of field z" I need to add the id of the card where the foundchunk was found. It would be convenient to know the id rather than the number of field z.

I can't remember if some function similar to the foundchunk includes the card ID of the foundchunk, or if I have to script it. The long foundchunk? Probly not...

I don't need a correct working script, just a few hints.

Your little hints save me hours of dictionary-studying and trial and error scripting. I really appreciate them.

Tim






More information about the use-livecode mailing list