Vector.Find Method

Overload List

#SignatureDescription
1function Find(const X: TCplx): Integer;Compare complex value X with all calling object elements.
2function Find(const X: Double): Integer;Finds a match for X in object values.

Overload 1: function Find(const X: TCplx): Integer;

Compare complex value X with all calling object elements.

#NameTypeDescription
1XTCplx

Returns: Int32 - the Index of last matched element.

Remarks:

If no matching elements are found, the result is -1. An exception is raised if calling object Vector.Complex property is false.

Overload 2: function Find(const X: Double): Integer;

Finds a match for X in object values.

#NameTypeDescription
1XDouble

Returns: Int32

Remarks:

Compare real value X with all calling object elements and return the Index of last matched element. If no matching elements are found, the result is -1.

Note
This method also supports the NAN and INF search.

Examples
var a: Vector;
    ind: Integer;
begin
    a.SetIt(False,[2,5,1,6]);
    ind := a.Find(1.0); // returns 2 (the arrays are zero based)
end;