Author Topic: how to use qsort  (Read 799 times)

0 Members and 3 Guests are viewing this topic.

jcfuller

  • Guest
how to use qsort
« on: July 30, 2019, 03:27:25 PM »
Charles,
  Can't get qsort to work.

James

Charles Pegge

  • Guest
Re: how to use qsort
« Reply #1 on: July 30, 2019, 11:08:37 PM »
Hi James,

This fixes the problem with callback and void* params:

Code: [Select]
'32bit cdecl callback
'Function TypeCompare cdecl (void *a, void *b) As Integer, callback

'64bit callback
Function TypeCompare (void *a, void *b) As Integer, callback
InfoType Ptr ia = (InfoType Ptr) a
InfoType Ptr ib = (InfoType Ptr) b
Function = ((100 * ia.f2013) - (100 * ib.f2013))
End Function