INMAT


The INMAT() function returns the number of dimensioned array elements.

 

COMMAND SYNTAX

INMAT( {array} )

 

DESCRIPTION

The INMAT() function, used without the 'array' argument, returns the number of dimensioned array elements from the most recent MATREAD, MATREADU or MATPARSE statement. If the number of array elements exceeds the number of elements specified in the corresponding DIM statement, the INMAT() function will return zero.

When the INMAT() function is used with the 'array' argument, it returns the current number of elements to which 'array' was dimensioned.

 

NOTES

In some dialects the INMAT() function is also used to return the modulo of a file after the execution of an OPEN statement. This is inconsistent with its primary purpose and has not been implemented in jBASE. To achieve this functionality use the IOCTL() function with the JIOCTL_COMMAND_FILESTATUS command.

 

EXAMPLE

OPEN "CUSTOMERS" TO CUSTOMERS ELSE STOP 201, "CUSTOMERS"
DIM CUSTREC(99)
ELEMENTS = INMAT(CUSTREC) ; * Returns the value "99" to the variable ELEMENTS
ID = "149"
MATREAD CUSTREC FROM CUSTOMERS, ID THEN
    CUSTREC.ELEMENTS = INMAT() ; * Returns the number of elements in the CUSTREC array to the variable CUSTREC.ELEMENTS
END


jBC