You are here: Symbol Reference > MtxVec Namespace > Classes > TVec Class > public > SetIt Method > TVec.SetIt Method (boolean, array of double)
MtxVec VCL
ContentsIndex
PreviousUpNext
TVec.SetIt Method (boolean, array of double)

Sets vector values.

Pascal
function SetIt(AComplex: boolean; const A: array of double): TVec; overload;

SetIt makes the use of open array construction, to set the values of the calling vector. It gives you the possibility to pass large arrays of elements without having to declare constant arrays. 

Sets the Length property of the calling vector to (High(A)+1) and the TMtxVec.Complex property to AComplex. The elements of A array are copied to the calling vector. If AComplex is True then real parts of complex numbers are on even (0,2,4..) and imaginary parts on odd indexes (1,3,5,..).

var a: TVec; begin CreateIt(a); try a.SetIt(False,[1,2,3,4]); // a = [1,2,3,4] finally FreeIt(a); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!