Repeats repeated

Terry Vogelaar terry at discovery.nl
Sun Nov 3 22:22:01 EST 2002


David Vaughan heeft op zondag, 3 nov 2002 om 22:10 het volgende 
geschreven:

>> ... like David I really cannot imagine why Richard's suggestion about 
>> using arrays would contribute anything to the speed, but I tried it 
>> and it obviously worked; it reduced my (fastest) 101 seconds to 36!
>
> My problem was not in imagining it would be faster but in would be the 
> code :-), given your particular problem.
> Would you mind showing your new solution, on or off list?

Of course:

   put the number of lines of t into s
   split t by return
   repeat with f1 = 1 to s - 2
     put t[f1] into g1
     repeat with f2 = f1+1 to s - 1
       put t[f2] into g2
       repeat with f3 = f2+1 to s
         put t[f3] into g3
         put g1 & "," & g2 & "," & g3 & return after outvar
       end repeat
     end repeat
   end repeat

You see, no big changes with the first script. It only uses an array 
instead of the lines of a variable (25 secs faster) and outputs it to a 
var instead of to a field (40 secs faster).

Terry





More information about the Use-livecode mailing list