As for sorting, well maybe not ideal to sort something that is tied in with an object. So if thing(3) for instance was also object 3, then really your stuck with it as it is, or you could make an index - an index might be a simple dimmed array with the index (3 for example) and the sort value, maybe the world position or something. That way each index would be sorted by it's sort value.
Dim thingdex(3,1)
So 3 things, with 2 indices in the index, indice #,0 is the index, indice #,1 is the sort value.
thingdex(0,0)=0 : thingdex(0,1)=10
thingdex(1,0)=1 : thingdex(1,1)=80
thingdex(2,0)=2 : thingdex(2,1)=20
thingdex(3,0)=3 : thingdex(3,1)=95
So that's the ID in slot 0, and the sort value, Y value, height, whatever in slot 1. Then it's easy to sort those with a boolean sort.
For a=0 to 3
For b=a+1 to 3
if thingdex(a,1)<thingdex(b,1)
t1=thingdex(a,0)
t2=thingdex(a,1)
thingdex(a,0)=thingdex(b,0)
thingdex(a,1)=thingdex(b,1)
thingdex(b,0)=t1
thingdex(b,1)=t2
endif
next b
Next a
So you'd have a index of ID's, sorted by whatever you need - if you step through thingdex then draw the items in that order for instance, then that might be the sort of thing you need. By using an index, you can reduce the amount of data that has to be moved, so rather than sorting a big typed array with all your 'thing' properties, you make an index and sort that, it does the same job except with minimal data.