Skip to content

TObjectSortCompare

Custom sort callback handler.

Declaration

Source position: avl_tree.pp line 47

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

Arguments

Name Description
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 TAVLTree.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 TAVLTree.OnCompare: it also passes the tree to the sort mechanism.

See also

Name Description
TAVLTree.OnObjectCompare Compare handler.
TAVLTree.OnCompare Compare function used when comparing nodes.