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

# TFPObjectList.FindInstanceOf

Search for an instance of a certain class

## Declaration

Source position: contnrs.pp line 54

`public function TFPObjectList.FindInstanceOf(`
`AClass: TClass;`
`AExact: Boolean;`
`AStartAt: Integer`
`):Integer;`

## Arguments

`AClass` |  | The class to look for
`AExact` |  | Should the class match exact or nor
`AStartAt` |  | Index to start the search at

## Function result

The first instance of the requested class.

## Description

FindInstanceOf will look through the instances in the list and will return the first instance which is a descendent of class AClass if AExact is False. If AExact is true, then the instance should be of class AClass.

If no instance of the requested class is found, Nil is returned.

## Errors

None.

## See also

TFPObjectList.IndexOf |  | Search for an object in the list

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