indexOf

indexOf(value: MemberType): Integer;

The indexOf method of the Array class returns the index of the entry specified in the value parameter if it exists in the array or it returns zero (0) if it does not exist. If the specified value occurs more than once in the array, the index of the first occurrence is returned.

The code fragment in the following example shows the use of the indexOf method.

epilog
    listBoxScrollBar.value := self.theArray.indexOf (myProduct);
    labelRight.caption     :="Time Taken := " & ((app.clock.Time -
                              startTime).Integer/1000).String & " Seconds";
    app.mousePointer:= self.MousePointer_Default;
end;

Use the indexOf64 method instead of the indexOf method, if the number of entries in the collection could exceed the maximum integer value of 2,147,483,647.