Sign in Join
FPDoc Onlineexperiment

TFPSMap.IndexOf function

Member of TFPSMappublicIn unit fgl

Index of key pointed to by AKey.

Declaration

pascal
function IndexOf(AKey: Pointer): Integer

Arguments

AKey

key to search for.

Function result

Index of AKey or -1 if AKey was not found.

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

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