Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Resize(const Src: TVecInt; const Len: Integer; const ZeroIt: Boolean): TVecInt; | Resizes vector size while preserving values. |
| 2 | function Resize(const Len: Integer; const ZeroIt: Boolean): TVecInt; | Resizes calling vector Length to Len. |
Overload 1: function Resize(const Src: TVecInt; const Len: Integer; const ZeroIt: Boolean): TVecInt;
Resizes vector size while preserving values.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TVecInt | |
| 2 | Len | Integer | element count |
| 3 | ZeroIt | Boolean |
Result: stored in self (calling object), returns self for chaining
Remarks:
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.
Examples
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;
Overload 2: function Resize(const Len: Integer; const ZeroIt: Boolean): TVecInt;
Resizes calling vector Length to Len.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Len | Integer | element count |
| 2 | ZeroIt | Boolean |
Result: stored in self (calling object), returns self for chaining
Remarks:
If VectorInt.Length is less than Len and ZeroIt parameter is true, the remaining calling vector values are set to zero.
Examples
var a: TVecInt;
begin
CreateIt(a);
try
a.SetIt([1,2,3]);
a.Resize(7,True); // a= [1,2,3,0,0,0,0]
finally
FreeIt(a);
end;
end;