Sign in Join
FPDoc Onlineexperiment

TObjectSortCompare procedure type

In unit AVL_Tree

Custom sort callback handler.

Declaration

pascal
TObjectSortCompare = function(Tree: TAVLTree; Data1: Pointer; 
 Data2: Pointer): Integer of object

Arguments

Tree

Tree that is comparing objects.

Data1

First object.

Data2

Second object.

Function result

one of -1, 0 or 1 depending on the comparison of data1 and data2.

Description

TObjectSortCompare is the prototype for the OnObjectCompare property. When assigned, it is used to sort the elements in the tree. It provides more information than the standard TListSortCompare handler used in OnCompare: it also passes the tree to the sort mechanism.

See also

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