Re: How to stay on a card when repeating a « find »

Eric Chatonet eric.chatonet at sosmartsoftware.com
Mon Feb 6 11:46:46 EST 2006


Bonjour André,

To make your decision, just do a test :-)
In a brand new stack:

on mouseUp
     local tStart, tNumOfCards = 2000, tNumOfTests = 10
     -----
     put "Creating" && tNumOfCards && "cards"
     lock screen
     repeat tNumOfCards
         new card
         set the dontSearch of this cd to random(100) > 50
     end repeat
     -----
   unlock screen
     put "Now testing"
     put the milliseconds into tStart
     repeat tNumOfTests
         repeat for each line tCd in the cardNames of this stack
             set the dontSearch of tCd to true
         end repeat
     end repeat
     put (the milliseconds - tStart) div  tNumOfTests &&  
"milliseconds for" && tNumOfCards && "cards"
end mouseUp

I have just modified Jacque very clever idea by using a repeat for  
each form that usually is far faster than repeat with i = 1 to x.
Actually my purpose was to show how it's easy and quick to write a  
little script to make one's decision:
The test takes here about an average of 100 milliseconds for 2000  
cards :-)

Le 6 févr. 06 à 13:55, André.Bisseret a écrit :

> Jacqueline, I like your tricky "dontsearch" solution. I tried it ;  
> currently I have 320 cards and it works well and is very fast.
> I am hesitating to use it because, at the end, after resetting the  
> dontsearch of all cds to false, I must reset the dontsearch of  
> certain cards to true ; well, anyway, the whole thing is running  
> very fast !
> Also, the number of cards in my app. is going to grow each years,  
> so this solution could be provisional ; well, why not !
> I have to make a decison, but, thanks to this list,  it is really  
> comfortable to can choose among several solutions !

Best Regards from Paris,
Eric Chatonet
------------------------------------------------------------------------ 
----------------------
http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/





More information about the use-livecode mailing list