## INMAT() |

The INMAT() function provides qualifying information after certain statements are executed.
Format
INMAT({mat})
where
Used without a mat matrix name, the INMAT() function returns information relating to the last use of the following statements
Further details of the information returned by INMAT() in each case is documented with the relevant statement.
Used with a matrix name, the INMAT() function returns the current dimensions of the matrix, including matrices in data collection variables. If mat is a single dimensional matrix, INMAT() returns the number of elements, excluding the zero element. If mat is a two dimensional matrix, INMAT() returns the number of rows and columns as two values separated by a value mark.
Examples
DIM A(N) IF INMAT() THEN ABORT "Insufficient memory"
This program fragment dimensions matrix A and tests whether it was successful. If not, the program aborts. With memory sizes found on modern computer systems, dimensioning a matrix is very unlikely to fail and this test is usually omitted.
N = INMAT(A) FOR I = 1 TO N A(I) += 1 NEXT I
This program fragment adds one to each element of matrix A. The INMAT() function is used because the matrix was dimensioned elsewhere and hence its size is not known. |