Sorting on a single dimension and shuffling the data so that the other dimensions corresponded to the same data as before would be the way to go:

DIM $a[1,1]

$a[0,0]=1
$a[0,1]=0
$a[1,1]=2
$a[1,0]=3

A table:
--------2nd dimension
-------- 0 1
1st---0 1 0
------1 3 2

To sort this, you have to specify which row or column to sort. This causes a problem because there are 4 different ways to sort.

If you have more than 2 dimensions, it gets even dicier because you have to realign all of the other dimensions to the one you sort on.

(Major mindbender!!)

Brian