function Find(const X: integer): integer; overload;
Finds a match for X in object values.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | integer |
Returns: integer - the index of first matched element. If no matching elements are found, the result is -1.
Remarks:
Compare real value X with all calling object elements.
Examples
var a: VectorInt;
ind: Integer;
begin
a := TVecInt.Create;
try
a := [2,5,1,6];
ind := a.Find(1); // returns 2 (the arrays are zero based)
finally
a.Free;
end;
end;
Indexed: function Find(const X: integer; const Index: integer; Len: integer): integer; overload;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | integer | |
| 2 | Index | integer | start index |
| 3 | Len | integer | element count |
Returns: integer