I'm using the following :
SORTARRAY localHiscores[],ADDRESSOF(sortRoutine_Local)
with the following compare routine :
FUNCTION sortRoutine_Local%:a AS tLocalHiscores,b AS tLocalHiscores
IF a.score%>b.score%
RETURN -1
ELSE
IF a.score%<b.score%
RETURN 1
ELSE
RETURN 0
ENDIF
ENDIF
ENDFUNCTION
to sort an array of the following TYPE :
TYPE tLocalHiscores
name$
score%
grade$
ENDTYPE
But for some reason the program crashes.
Return value of that function must not be "%".
Yes, that's solved it - thanks!
Might need to change the help file there as "SORTARRAY array[], cmp%" implies the comparison function returns an integer.