HP 3000 Manuals

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


HP Business BASIC/XL Reference Manual

COL 

The COL function returns the number of columns in an array as it is
currently dimensioned.  If it is a vector (a one dimensional array), the
number of columns is one.  Otherwise, the number of columns is the size
of the rightmost dimension.  The result is an integer value by default.

Syntax 

COL(array)

Parameters 

array            Structured collection of variables of the same type.
                 The structure is determined when the array is declared.
                 String variables names are suffixed with a "$".

Examples 

OPTION BASE 1 is assumed.

The following shows several examples of the result of the COL function on
arrays A, B,C,D,E, and F.

     A(2,2): 1 2   B(2,4):  1 2 3 4   C(4,3,2): 1 2  0 4   0 0  1 2
             4 5            5 6 7 8             5 1  1 0   4 5  0 0
                                                2 0  3 2   1 2  0 1

     D(3,3): 1 0 1  E(2,2): 8 3       F(5): 5 4 3 2 1
             3 5 7          4 7
             9 0 9

     COL(A) = 2
     COL(B) = 4
     COL(C) = 2
     COL(D) = 3
     COL(E) = 2
     COL(F) = 1



MPE/iX 5.0 Documentation