IMath.SumI

Syntax

SumI(Values: Array): Integer;

Parameters

Values. Array of integer numbers.

Description

The SumI method returns the sum of elements (integers) of the specified array.

Comments

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.

Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    r: Integer;
    Arr: Array[4Of 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:

IMath