RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWordArray.IndexOf Method

Returns the position of the first element with a specified value.

Pascal
function IndexOf(var Item): Integer; override;
C++
virtual __fastcall int IndexOf( Item);

Call IndexOf to obtain the position of the first occurrence of the value Value. IndexOf returns the 0-based index of the element. Thus, if Value matches the first element in the array, IndexOf returns 0, if Value matches the second element, IndexOf returns 1, and so on. If the value is not in the array, IndexOf returns -1.

Note: IndexOf does not work for arrays sorted in descending order.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!