I created a stack to do some testing to see about making a function that could do multiple types of tests. What I found was that adding another if at that point added about 6% to the search time and a second level (else if) added another 10% (16% total). (I added a parameter for search type - "String". I used "String2" to get a second option, but used the same test). When I used number instead of strings it was a little lower, but not much (5.5% and 11% total)
> In terms of generalizing that function - then the key line which checks > whether an element matches is: > > else if tElement contains pNeedle then > > One could imagine that this could be an arbitrary predicate - pNeedle > doesn't have to be a string, so could be an array representing a AND / OR > style query; or could be a regex (in which case you'd use matchText). > > Warmest Regards, > > Mark. > > -- > Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ > LiveCode: Everyone can create apps > _______________________________________________ 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