System.Classes.TList.IndexOf

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function IndexOf(Item: Pointer): Integer;

C++

int __fastcall IndexOf(void * Item);

Properties

Type Visibility Source Unit Parent
function public
System.Classes.pas
System.Classes.hpp
System.Classes TList

Description

Returns the index of the first entry in the Items array with a specified value.

Call IndexOf to get the index for a pointer in the Items array. Specify the pointer as the Item parameter.

The first item in the array has index 0, the second item has index 1, and so on. If an item is not in the list, IndexOf returns -1. If a pointer appears more than once in the array, IndexOf returns the index of the first appearance.

See Also

Code Examples