RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TObjectList.IndexOf Method

Returns the index of the first object in the list with a specified value.

Pascal
function IndexOf(AObject: TObject): Integer;
C++
__fastcall int IndexOf(TObject * AObject);

Call IndexOf to get the index for a specified object in the list, where the first object has index 0, the second object has index 1, and so on. If an object is not in the list, IndexOf returns -1. If an object appears more than once, IndexOf returns the index of the first appearance. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!