HP 3000 Manuals

RSUM [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

RSUM 

The RSUM function returns an array that contains the sum of the elements
of each row of an array.  Both arrays must be of the same type.  This has
the format

     MAT num_array1 = RSUM(num_array2)

where element i of num_array1 is the sum of the elements in row i in
num_array2.  num_array2 is dimensioned (m,n) and num_array1 is
dimensioned (m).

This function is used in the MAT = statement, with two-dimensional
arrays.

Syntax 

RSUM(array)

Parameters 

array            Structured collection of variables of the same type.
                 The structure is determined when the array is declared.

Examples 

     10  DIM A(3)
     20  DIM B(3,4)
     .
     .
     .
     80 MAT A = RSUM(B)

IF B is

     8 5 7 3
     0 2 9 1
     4 6 0 5

then A is

     23 12 15



MPE/iX 5.0 Documentation