[Overview][Classes][Index] | Reference for unit 'AVL_Tree' (#fcl)

# TAVLTree.FindKey

Find a data item in the tree using alternate compare mechanism

## Declaration

Source position: avl_tree.pp line 63

`public function TAVLTree.FindKey(`
`Key: Pointer;`
`OnCompareKeyWithData: TListSortCompare`
`):TAVLTreeNode;`

## Arguments

`Key` |  | Data item to search for.
`OnCompareKeyWithData` |  | Data pointer comparison callback

## Function result

Tree node corresponding to Key item.

## Description

FindKey uses the specified OnCompareKeyWithData comparing function to find the Key pointer in the tree It returns the TAVLTreeNode instance that matches the Data pointer, or Nil if none is found.

## See also

OnCompare |  | Compare function used when comparing nodes
Find |  | Find a data item in the tree.

The latest version of this document can be found at lazarus-ccr.sourceforge.net .