Newbie: find, search command
ambassador at fourthworld.com
Thu Dec 16 17:32:02 CST 2004
> I have a tab delimited list I want to be able to search, say I have a list of names for example;
> Father Xmas Is Drunk
> New Years Is after Xmas
> Rudolph The Reindeer
> Merry Xmas To all
> I want to search for ALL instances of Xmas and display the whole matching line of each found in a list field.
> So far I can get it to display the first line only ( Father Xmas Is Drunk) !
> Any help would appreciated!!! I have checked the tutorials for help but couldn't find what I was looking for,
> is there an example stack or notes anyone may know of?
For short lists (<50,000 lines) you may be pleasantly surprised by the
speed of what might look like clunkly Transcript:
function FindData pStringToFind, pDataToSearch
repeat for each line tLine in pDataToSearch
if pStringToFind is in tLine then put tLine &cr after tFoundData
You can call it simply enough:
put FindData("Xmas", fld "stuff")
Fourth World Media Corporation
Rev tools and more: http://www.fourthworld.com/rev
More information about the use-livecode