Can this be done faster ?
Jim Ault
JimAultWins at yahoo.com
Fri Jul 21 13:46:01 EDT 2006
I would use the following type of loop
put the ticks into timer
set the itemdel to tab --or what applies
filter databaseList without empty
repeat for each line txtLine in databaseList
put doaction(txtLine) & cr after newListing
end repeat
filter newListing without empty
put the ticks - timer
sort newListing by item 4 of each
Jim Ault
Las Vegas
On 7/20/06 7:27 PM, "John Miller" <johnmiller1950 at sbcglobal.net> wrote:
> JB,
>
> I once wrote an inventory control program for a company using
> Revolution. They had many thousands of items that I read out of
> their database and then sorted and processed.
>
> I found that using a repeat for that many items was extremely slow.
> The solution that I found which made things blazingly fast was to
> only process about 50 items at a time.
>
> For instance:
>
>
> put 50 into XX
> put the ticks into timer
> repeat until listXX is empty
> put line 1 to XX of listXX into listYY
> delete line 1 to XX of listXX
> repeat with x = 1 to (number of lines in listYY)
> doaction to line x of listYY
> end repeat
> end repeat
> put the ticks - timer
>
>
> Using the format above, you can experiment to see which value for XX
> is the most advantageous. I was able to whittle my time down from 45
> seconds to less than 1.
>
> Good Luck
> John Miller
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list