I’m trying to sort a TStringList in an especific order.
Instead of A,B,C.. I’m trying to order it in B,C,A.
I’ve declarated a const array with the order that I need.
I’ve tried with CustomSorte, but I can’t understand how to write the function.
I’m trying with for loops now, but it is going really hard and confusing!
I’m not a Delphi Expert…
Thank you guys in advance!
From the help about the
TStringListSortComparefunction type:So if you subtract your custom order of the second item from the custom order of the first one, then the items will be sorted like you want.