Hi Tim. If you don't care about finding 3 occurrences of FF in FFFF (FF__, _FF_, __FF) then try this:
replace mySearch with cr & mySearch & cr in myString filter myString with mySearch put the number of lines of myString into theCount Bob On Mar 9, 2012, at 12:28 PM, Timothy Miller wrote: > 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 > > > > _______________________________________________ > 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 _______________________________________________ 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