function Sum: Integer;
Sums vector values.
Returns: Int32 - the sum of all calling object elements.
Examples
Uses MtxExprInt;
procedure Example;
var a: VectorInt;
b: integer;
begin
a := [1,2,3,4];
b := a.Sum; // b = 10
FreeIt(a);
end;
Indexed: function Sum(const Index: Integer; const Len: Integer): Integer;
Returns the sum of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Integer | start index |
| 2 | Len | Integer | element count |
Returns: Int32
Remarks:
An exception is raised if array borders are overrun/underrun.