I’ve got an array that’s constructed like this: array = [[a1,[b1,c1,d1]], [a2,[b2,c2,d2]], [a3,[b3,c3,d3]], [a4,[b4,c4,d4], …]

‘a’ is a floating point, ‘b’ is a Point3d and ‘c’ and ‘d’ is a string.

I want to sort this array for ‘a’, so I use array.sort. This works fine unless two values of ‘a’ are equal. In two values for ‘a’ are equal the sort function will sort on the next element of the array which is ‘b’. These are Point3d’s so they can’t get sorted.

I found out about the .sort_by method which is implemented from ruby 1.8.7, but I’m using SketchUp 8, so I’m restricted to ruby 1.8.6. Does anyone have another solution?