Sign in Join
FPDoc Onlineexperiment

TFPSMap.Find function

Member of TFPSMappublicIn unit fgl

Find data using the associated key.

Declaration

pascal
function Find(AKey: Pointer; out Index: Integer): Boolean

Arguments

AKey

Key to search for.

Index

Index of first key smaller than Akey.

Function result

True if an exact match was found.

Description

Find searches for the first key less than or equal to AKey and returns its index in the list in Index. It returns True if an exact match for the key was found. It returns False if the key was not found, and Index is then set to -1

This function performs a binary search using the key comparing function specified in OnKeyPtrCompare.

Errors

if OnKeyPtrCompare is not set, an access violation will occur.

See also

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