Internet Direct (Indy) Version 9.0.2 Beta
TIdObjectList.FindInstanceOf
Finds the first instance of a specified class in the list.

function FindInstanceOf(AClassRef: TClass; AMatchExact: Boolean; AStartPos: Integer): Integer;
Parameters
AClassRef: TClass
CLass instance to be located in the list.

AMatchExact: Boolean = True
Indicates if descendants classes are a match. Default value is True.

AStartPos: Integer = 0
Initial position to start the search. Default value is 0.

Returns
Integer - Index position of the class instance.

Description
FindInstanceOf is an Integer function that returns the index of the first instance of AClass appearing after the AStartAt index position in the Items array. If AExact is True, FindInstanceOf returns instances only of AClass itself, ignoring instances descendant classes. If no instance of the specified class is found, FindInstanceOf returns –1.