Fastest way to sort large 2-D arrays?
assume the indexes are in a 1 based array named arrIdx
msgbox arr(arrIdx(5)-1,7)
will return the 5th item/row, 8th column from the original array as if it
had been sorted.
This assumes the 1 based array holds index numbers as if the original array
were 1-based. If not, then remove the -1.
--
Regards,
Tom Ogilvy
"RB Smissaert" wrote in message
...
I have come across one major problem and that is that the VSORT routine
will change 0-based arrays to 1-based arrays. I have searched everywhere
about this, but couldn't find anything about it. I have e-mailed Laurent
Longre
and maybe he can help out.
Had a look at the help about VSORT.IDX, but not sure how it would help me
sorting a 2-D array, particularly an 0-based 2-D array where I want to
keep
the
base at 0.
RBS
"Daniel.M" wrote in message
...
Hi,
I think I worked this all out now.
Although it will need making an extra (the array holding the values to
sort
on)
You could assign to new array sorted to the old one (depending on your
needs).
arr = VSORTArray(arr,...)
Note that in cases of big arrays to sort and depending on the problem
(you
know,
I don't), it might be a good idea to look at VSORT.IDX function which
only
returns 1 column wide of INDEXES, that is pointers to the indices of the
'rows'
as if they were sorted. It's a very powerful function.
Regards,
Daniel M.
|