Hmmm. Provided the number of elements aren't too large, the stack overflow should be avoidable. The sorting function that I prepared can handle over a million items, and I could probably increase that. It is NOT recursive, so it is unlikely to run low on stack space in that manner. If stack space becomes a problem, there is always the ability to write temporary files to disk. The only problem with this is the slowdown. Another possibility is to leave the initial array intact and merely sort the indexes. This should cut down on stack space somewhat, and if done properly speed things up quite a bit.

Brian