Repeat for each

Marty Knapp martyknapp at comcast.net
Wed Nov 9 21:12:46 EST 2005


Alex Tweedly wrote:

> Marty Knapp wrote:
>
>>
>> I've been tinkering with this a bit and wanted to ask a few more 
>> questions. Again, my data set is 8 items with all but one being a 
>> number. I need to be able to select a subset by analysing 1 or more 
>> of these items. My current data set is approx 128,000 records. When I 
>> filter the data on the item that contains words, it's pretty fast - 
>> about 1 second (I have an old Mac G4-single processor 867mgz, and 
>> running Rev 2.2.1) The speed is exactly the same whether I use the 
>> above method or just 'filter theData with "*word*"'
>>
> That seems terribly slow to me :-)


That's what I thought! Interestingly enough in my repeat for each loop I 
had "set cursor to busy" and that's what was bring this thing to its 
knees. I knew that a progress indicator was a hog, but had no idea that 
this would take such a heavy toll. Searches that were running 5 minutes 
now take about 5 seconds. That still isn't terribly fast - maybe my 
older computer is to blame? Are there any speed improvements between the 
current version of Rev and mine (2.2.1)?

Here's a line from my data: 61187,digital camera 
driver,1.18,3219,3450000,1071,4,9.1

And a typical repeat loop:

  repeat for each line theLine in sourceData
    if item 7 of theLine >50 and item 8 of theLine >2 then put theLine & 
return after allResults
  end repeat


Marty



More information about the use-livecode mailing list