Skip to content

TFPList.IndexOfItem

Search an item in the list

Declaration

Source position: classesh.inc line 252

public 
  function IndexOfItem(Item: Pointer; Direction: TDirection) : Integer;

Description

IndexOfItem has the same function as the IndexOf]() function: it searches for Item in the list, and returns the index of the first found matching pointer. If none is found, -1 is returned.

In difference with the IndexOf function, it accepts a parameter Direction indicating the search direction: from the beginning of the list till the end of the list, or from the end of the list till the beginning. The IndexOf function starts at the beginning of the list. The search direction is only important if the item can appear multiple times in the list.

See also

Name Description
TFPList.IndexOf Returns the index of a given pointer.
TFPList.TDirection Search direction for IndexOfItem