|Post date: 2007-05-10 15:47|
I found a "bug" in your code. With an array of 32767 you get overflow so you need to declare you integer variables to something larger like Long or Double. Probably you should write it as a function as well, makes it more useful..
Tomas - I took the liberty to do a very quick comparison.
Kennets solution did sort an array containing 32767 entries of seven figure numbers in around 3000 msec.
You solution could only hold around 16000 entries with two figur numbers and did a sort in 800Msec.
Kenneths solution with the same settings: 1000msec
This on a client running notes R7.01 and with profiling enabled to get the results.
Kenneths solution is way more flexible and personally I like to stay away from Evaluate as much as possible, the performance is at least similar.