Thanks Peter. That would work fine for a fixed list, or the current 3 items, but if the list grows, I would have to edit the script. I ended up using repeat for each, and since even the large list is less than 100 lines, it is done in a few milliseconds.
~Roger On Jul 20, 2013 12:22 PM, "Peter M. Brigham" <[email protected]> wrote: > How about something like this: > > put tList into list1 > put tList into list2 > put tList into list3 > filter list1 with "*" & item 1 of gCodes & "*" > filter list2 with "*" & item 2 of gCodes & "*" > filter list3 with "*" & item 3 of gCodes & "*" > put list1 & cr & list2 & cr & list3 into outputList > > -- Peter > > Peter M. Brigham > [email protected] > http://home.comcast.net/~pmbrig > > > On Jul 11, 2013, at 11:08 AM, Roger Eller wrote: > > > global gCodes > > put tList into tGood; put tList into tBad > > put "PPX,RRY,NNZ" into gCodes > > -- Keep lines that contain any item of gCodes > > filter tGood with ("*" & item 1 of gCodes & "*") or ("*" & item 2 of > gCodes > > & "*") or ("*" & item 3 of gCodes & "*") > > filter tBad without ("*" & item 1 of gCodes & "*") or ("*" & item 2 of > gCodes > > & "*") or ("*" & item 3 of gCodes & "*") > > > > Perhaps I should just loop through each line checking if it 'contains' > one > > of the codes instead? > > Is there a better approach? <I'm sure there is>... > > > > ~Roger > > _______________________________________________ > > use-livecode mailing list > > [email protected] > > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-livecode > > > _______________________________________________ > use-livecode mailing list > [email protected] > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > _______________________________________________ use-livecode mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
