arrays

Ken Ray kray at sonsothunder.com
Thu May 21 13:29:59 EDT 2009


> The "filter" command is one of those things that you can stare at for
> a while, but it doesn't really click until you have a use for it. Then
> whole new worlds open up.

On major caveat on "filter" though, and that is that the closer to the left
edge of a line the filter is acting on (or the less complex the filter), the
faster it will run.

For example, let's say you have 2000 lines of data that's formatted into 10
columns (tab-separated). If you want to search for the string "test" in the
first column, the filter is something like:

"*test*"

If you want to look to see if it's in the second column, it would be:

".*" & tab & "*test*"

and the third column would be:

".*" & tab & ".*" & tab & "*test*"

etc.

Using this approach, filtering in column 10 is WAY slower than filtering in
column 1.

Anyway, just wanted to bring up that filter can be really fast, but when it
gets slow you'll want to pick another method.

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/





More information about the use-livecode mailing list