Sign in Join
FPDoc Onlineexperiment

TCollectionSortCompare procedure type

In unit Classes

Callback to sort collection items.

Declaration

pascal
TCollectionSortCompare = function(Item1: TCollectionItem; 
 Item2: TCollectionItem): Integer

Description

TCollectionSortCompare is the prototype for a callback used in the Sort method. The procedure should compare Item1 and Item2 and return an integer:

Result < 0
if Item1 comes before Item2
Result = 0
if Item1 is at the same level as Item2
Result > 0
if Item1 comes after Item2

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.