Page 1 of 1

Never use the wrong type in SortStructuredList()

Posted: Wed May 19, 2021 10:40 pm
by ricardo_sdl
Changed some variable type from Long to Unicode, but forgot to change the type in a call to SortStructuredList.

Code: Select all

;DrawingOrder was Long but now is Unicode
;I should have changed #PB_long to #PB_Unicode bellow
SortStructuredList(Drawables(), #PB_Sort_Ascending, OffsetOf(TDrawable\DrawingOrder), #PB_Long);
It took me hours to figure out what was wrong. Lots of "Am I going crazy here?" :oops:

Re: Never use the wrong type in SortStructuredList()

Posted: Thu May 20, 2021 8:23 am
by Fred
That's why you should use TypeOf() instead: https://www.purebasic.com/documentation ... dlist.html

Re: Never use the wrong type in SortStructuredList()

Posted: Thu May 20, 2021 2:49 pm
by ricardo_sdl
Changing it now! :)