Topic Path: Symbol Reference > Classes > TIdDBList Class > TIdDBList Methods > IndexOf Method
TIdDBList.IndexOf Method

Determines the ordinal position (or index) of a specified collection item in the collection.

function IndexOf(
    AItem: TIdDBInfo
): Integer;
Collection item to locate in the container. 

>=0 - Ordinal position (0-based) of the collection item. -1 - Collection item does not exist in the container.

IndexOf is an Integer function used to determine the ordinal position (or index) of the collection item specified in AItem in the collection. 

The return value is the 0-based index of the collection item in the container, or -1 when the collection item does not exist in the container. 

Use Items to access (read/write) collection items using the index position of the item in the collection. 

Use Add to create a new collection item in the container.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.