[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'db' (#fcl)

# TLookupList.FirstKeyByValue

Find the first key that matches a value

## Declaration

Source position: db.pas line 254

`public function TLookupList.FirstKeyByValue(`
`const AValue: Variant`
`):Variant;`

## Arguments

`AValue` |  | Value to match key with.

## Function result

First key that has AValue associated with it.

## Description

FirstKeyByValue does a reverse lookup: it returns the first key value in the list that matches the AValue value. If none is found, Null is returned. This mechanism is quite slow, as a linear search is performed.

## Errors

If no key is found, Null is returned.

## See also

TLookupList.ValueOfKey |  | Look up value based on a key

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