RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TValueListStrings.CustomSort Method

Sorts the strings in the list in a customized order.

Pascal
procedure CustomSort(Compare: TStringListSortCompare); override;
C++
virtual __fastcall CustomSort(TStringListSortCompare Compare);

Use CustomSort to sort the strings in the list, where the sort order is defined by the Compare parameter.  

Supply a value for the Compare function that compares two strings in the string list. The List parameter provides access to the string list, while the Index1 and Index2 parameters identify the strings to be compared. 

Do not pass nil (Delphi) or NULL (C++) as the value of the Compare parameter.

Note: You must explicitly call the CustomSort method. Setting the Sorted property only sorts strings using ANSI (Windows) or UTF-8 (Linux) order, as implemented in the Sort method.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!