Never use the wrong type in SortStructuredList()

Everything else that doesn't fall into one of the other PB categories.
ricardo_sdl
Enthusiast
Enthusiast
Posts: 109
Joined: Sat Sep 21, 2019 4:24 pm

Never use the wrong type in SortStructuredList()

Post 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:
You can check my games at:
https://ricardo-sdl.itch.io/
Fred
Administrator
Administrator
Posts: 16621
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Never use the wrong type in SortStructuredList()

Post by Fred »

That's why you should use TypeOf() instead: https://www.purebasic.com/documentation ... dlist.html
ricardo_sdl
Enthusiast
Enthusiast
Posts: 109
Joined: Sat Sep 21, 2019 4:24 pm

Re: Never use the wrong type in SortStructuredList()

Post by ricardo_sdl »

Changing it now! :)
You can check my games at:
https://ricardo-sdl.itch.io/
Post Reply