Modal sorting

BlitzMax Forums/BlitzMax Beginners Area/Modal sorting

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.

Directly: you can't, BM has no priority sort with counting support.

Indirectly: Make an own compare function and use TList.

In the compare function, you cast the 2 objects to your own "container" class for the unique words. That container class has a field "count:int"
Whenever you find containerClass(a) == containerClass(b) (or how you call the 2 :object instances in the compare function), you raise the count of a and return 0.

when they are not equal, you return containerClass(a).count - containerClass(b).count