Unit 'Classes' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

TStrings.IndexOfObject

Finds an object in the list and returns its index.

Declaration

Source position: classesh.inc line 1026

public function TStrings.IndexOfObject(

  AObject: TObject

):Integer; virtual;

Description

IndexOfObject searches through the list of strings till it find a string associated with AObject, and returns the index of this string. If no such string is found, -1 is returned.

Remark:
  1. Only the first occurrence of a string with associated object AObject is returned; if more strings in the list can be associated with AObject, they will not be found by this routine.
  2. The returned position is zero-based, i.e. 0 indicates the first string in the list.

See also

TStrings.LastIndexOf

  

Return the index of the last occurrence of a string.

TStrings.IndexOf

  

Find a string in the list and return its position.

TStrings.Objects

  

Indexed access to the objects associated with the strings in the list.


Documentation generated on: Dec 25 2024