VectorInt.Copy Method

function Copy(const Src: TMtxVecInt): TMtxVecInt;

Copy object values.

#NameTypeDescription
1SrcTMtxVecInt

Result: stored in self (calling object), returns self for chaining

Remarks:

Copy each of Vec elements to the calling object. Size and precision properties of the calling object are set implicitly to match Vec object.

Examples
uses MtxVecInt;

procedure Example;
var a,b: TMtxVecInt;
begin
    a := TMtxVecInt.Create();
    b := TMtxVecInt.Create();
    try
        a.SetIt([1,2,3,4]);  // a = [1,2,3,4]
        b.Copy(a);           // b = [1,2,3,4]
    finally
        a.Free;
        b.Free;
    end;
end;

Indexed: function Copy(const Src: TMtxVecInt; const SrcIndex: Integer; const Index: Integer; const Len: Integer): TMtxVecInt;

Copy Src elements [SrcIndex]..[SrcIndex+Len-1] in the calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1SrcTMtxVecInt
2SrcIndexIntegersource start index
3IndexIntegerstart index
4LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Remarks:

Vector VectorInt.Size must be set explicitly. An exception is raised if array borders are overrun or underrun.