#1 Today 07:34:30

jonsafi
Member
Registered: 2011-07-26
Posts: 59

TRawUTF8List: sorting via Descending order...

Hello Everyone,

Currently have a routine using TStringList that makes use of the CustomSort
as follows:

....
My_TString_lst.CustomSort(SortDesc_BACKER);
....
Function SortDesc_BACKER(List: TStringList; Index1, Index2: Integer):Integer;
begin
  // Negate the result so a descending sort is done.
  Result := -AnsiCompareText(List[Index1], List[Index2]);
end;

Would like to change the code to make use of the much faster TRawUTF8List, but can't figure out an easy way to implement this custom sorting...

Any hints are more than welcome,
Thanks,
Sami.

Online

Board footer

Powered by FluxBB