Finding

Richard D. Miller wow at together.net
Sun Jan 6 07:31:01 EST 2002


Geoff:

Thanks for the suggestion. I'll try this out.

When I said, "way too slow" before, that was because I need to perform (on
average) ten such searches per user request...since the user is often
searching on ten different variables per request. So if it took 1 second per
search, that would total 10 seconds...and that's before the results are even
analyzed. It's just too long.

I don't know if this method will work as well for variations such as, "where
x > 10 and x < 20 " Will it still be fast enough? I'll give it a try.

Thanks to both of you for the suggestions.

Richard

> At 8:58 PM -0800 1/5/02, Scott Rossi wrote:
>> As a small test of my own, I made a field, filled it with 5000 lines of
>> random numbers, and ran the routine I suggested to find all occurrences of
>> the number 10.  On a 450mHz Mac, MC returns the result in 1.016 seconds.
>> Doesn't seem too slow to me...
> 
> Whenever repeating your way through data, the repeat for each form is
> generally much faster. This, for example, will execute in about 3 ticks (.05
> seconds) on a field with 5000 lines of numbers from 1 to 20 on my 400mHz Mac:
> 
> on mouseUp
> put 10 into N
> put fld "testField" into tData
> put empty into tSummary
> put 1 into x
> repeat for each line L in tData
> if L = N then put x & "," after tSummary
> add 1 to x
> end repeat
> delete last char of tSummary
> end mouseUp
> 
> Bill Vlahos is right about the filter command. I modified the routine that
> generated the random numbers for the above test to put the line number after
> the  random number, so the data looked like this:
> 
> 20 1
> 8 2
> 15 3
> 4 4
> 3 5
> 10 6
> 5 7
> 19 8
> 1 9
> 6 10
> 2 11
> 
> This allows using the Filter command: copy the data, filter the data, then
> pick up the line number (or whatever else) out of the filter results. The
> following script executes in 6 ticks, but not on 5000 lines of data, but
> 50,000!!
> 
> on mouseUp
> put fld "testField" into tData
> filter tData with "10*"
> end mouseUp
> 
> regards,
> 
> Geoff
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the Use-livecode mailing list