SumI(Values: Array): Integer;
Values. Array of integer numbers.
The SumI method returns the sum of elements (integers) of the specified array.
It is required to use an array of value of the Integer type.
The function works correctly with both one-dimension and two-dimension arrays.
To get the sum of real numbers, use the IMath.Sum method.
To execute the example, add a link to the MathFin system assembly.
Sub UserProc;
Var
r: Integer;
Arr: Array[4] Of Integer;
Begin
Arr[0] := -5;
Arr[1] := 158;
Arr[2] := 30;
Arr[3] := 5;
r := math.SumI(Arr);
Debug.WriteLine(r);
End Sub UserProc;
After executing the example the console window displays the sum of array elements equal to 188.
See also: