Custom Compare() method causes problems...

BlitzMax Forums/BlitzMax Programming/Custom Compare() method causes problems...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Like this:

function sortZ(bAscending:int=true)
  gElements.sort(bAscending,comparar)
end function

function comparar:int(Object o1, Object o2)
  local e1:TElement = TElement(o1) 
  local e2:TElement = TElement(o2)
  return o2.piZ-o1.piZ
end function


You not need the method compare%

Bye,
Paposo