You are here: Symbol Reference > MtxExprInt Namespace > Classes > VectorInt Record > public > Resize Method > VectorInt.Resize Method (TVecInt, integer, boolean)
MtxVec VCL
ContentsIndex
PreviousUpNext
VectorInt.Resize Method (TVecInt, integer, boolean)

Resizes vector size while preserving values.

Pascal
function Resize(const Src: TVecInt; const Len: integer; const ZeroIt: boolean = False): TVecInt; overload;

Resizes calling vector TMtxVecBase.Length to Len and fills it with Src vector first Len values. If Src length is less than Len and ZeroIt parameter is true, the remaining calling vector values are set to zero.

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