Hi Dennis,

Here's an approach that uses keyed arrays. Run time on an old iMac with 320 MB RAM and a 400 Mhz clock is 7.2 seconds.

on mouseUp
  global gTestArrayX,gTestArrayY
  if gTestArray is empty then
    repeat with i = 1 to 1000
      repeat with j = 1 to 1000
        put j into gTestArrayX[x,y]
      end repeat
    end repeat
    put gTestArrayX into gTestArrayY
  end if
  put the long seconds into startTime
  Method5
  get the long seconds
  answer "Elapsed time ="&&(it-startTime)&&"seconds."
end mouseUp

on Method5 -- Add lines using keyed arrays
  global gTestArrayX,gTestArrayY
  put 0 into theTotal
  repeat with i = 1 to 1000
    repeat with j = 1 to 1000
      add gTestArrayX[x,y]to theTotal
      add gTestArrayY[x,y]to theTotal
    end repeat
  end repeat
  put theTotal&&"Keyed Method"
end Method5
--
Rob Cozens, Staff Conservator
Mendonoma Marine Life Conservancy
P.O. Box 217
Manchester, CA 95459-0217
(707) 895-2584

"Promoting a healthy and bountiful offshore environment."
_______________________________________________
use-revolution mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to