Skip to content

TFPSMap.IndexOf

Index of key pointed to by AKey.

Declaration

Source position: fgl.pp line 295

public 
function TFPSMap.IndexOf(AKey: Pointer) : Integer;

Description

IndexOf returns the index of the element with a key pointed to by AKey. It returns -1 if the key was not found.

If the list is sorted, then a binary search is performed, otherwise a linear search is used to find the key.

Errors

None.

See also

Name Description
TFPSMap.Find Find data using the associated key.
TFPSMap.IndexOfData Index of data item AData.
TFPSMap.Keys Indexed access to the locations of all keys.
TFPSMap.Data Indexed access to the locations of all data items.