INMAT function

Syntax

INMAT ( [array] )

Description

Use the INMAT function to return the number of array elements that have been loaded after the execution of a MATREAD statements, MATREADL statement, MATREADU statement, or MATPARSE statement, or to return the modulo of a file after the execution of an OPEN statement. You can also use the INMAT function after a DIM statement to determine whether the DIM statement failed due to lack of available memory. If a preceding DIM statement fails, INMAT returns a value of 1.

If the matrix assignment exceeds the number of elements specified in its dimensioning statement, the zero element is loaded by the MATREAD, MATREADL, MATREADU, or MATPARSE statement. If the array dimensioning is too small and the zero element has been loaded, the INMAT function returns a value of 0.

If array is specified, the INMAT function returns the current dimensions of the array. If array is the null value, the INMAT function fails and the program terminates with a run-time error message.

Example

DIM X(6)
D='123456'
MATPARSE X FROM D,''
Y=INMAT()
PRINT 'Y= ':Y
*
DIM X(5)
A='CBDGFH'
MATPARSE X FROM A,''
C=INMAT()
PRINT 'C= ':C
*
OPEN '','VOC' TO FILE ELSE STOP
T=INMAT()
PRINT 'T= ':T

This is the program output:

Y= 6
C= 0
T= 23