BlitzMax won't magically guess how you want to sort it. When sorting objects, it relies on the 'Compare' method to be able to give the relative order of 2 objects. You need to define this method.Something like:
Type blahType 'define the class Field x, y Method Compare%(other:Object) Local t:blahType = blahType(other) If t = Null Then ' Not of the right type, fallback on default comparison Return Super.Compare(other) Else ' OK, let's compare them, first base on x, then y Local diff% = x - t.x If x = 0 Then diff = y - t.y EndIf Return diff EndIf End Method EndType