The ISVALID intrinsic enables you to check whether the following items contain a valid reference:
-
Procedure reference variable
-
Externally declared procedure (bound-in procedure)
-
Imported library procedure
-
Imported data identifier
-
Imported data array identifier
-
Formal procedure parameter
-
Structure block reference
-
Connection block reference
-
Array reference
-
Pointer
── ISVALID ── ( ───────────────────────────────────────────────────────► ►─┬─<procedure identifier>─────────────────────────────┬─ ) ───────────┤ ├─<procedure reference array element>────────────────┤ ├─<structure block reference identifier>─────────────┤ ├─<array reference identifier>─┬─┬───────────────────┤ ├─<pointer identifier>─────────┤ └─ , ─┬─ READABLE ──┤ ├─<data array identifier>──────┤ └─ READWRITE ─┘ └─<non-array data identifier>──┘
The ISVALID function returns a Boolean value indicating whether the procedure identifier or the procedure reference variable contains a proper link to a valid procedure, or whether the structure block reference identifier, connection block reference identifier, array reference identifier, or pointer identifier has been initialized.
The value FALSE is returned if the argument to ISVALID does not contain a proper link to a valid procedure or has not been initialized. The value TRUE is returned if the argument to ISVALID contains a proper link to a valid procedure or has been initialized. The procedure identifier can be a formal parameter in a procedure, a procedure imported from a library, or an externally declared procedure that is to be bound in. Externally declared procedures that are not bound in always return a FALSE result. This function does not check the validity of externally declared procedures that are to be linked with an external code file through a task identifier on the RUN, PROCESS, or CALL statement.
When an array, array reference, pointer, or non-array data identifier is used as the argument to ISVALID, the READABLE or READWRITE options can be specified to determine the access method through which these items are valid. If no option is specified for these types of data items, the default is READABLE.
When the READABLE option is specified, a TRUE result is returned by ISVALID if the item can be read. A FALSE result is returned if the item is uninitialized or is (or refers to) an IMPORTED array or IMPORTED non-array data item that has not been linked.
When the READWRITE option is specified, a TRUE result is returned by ISVALID if the item can be both read from and written to (that is, if the operand can be used on either side of an assignment operation). A FALSE result is returned if the item is uninitialized, is (or refers to) an IMPORTED array or IMPORTED non-array data item that has not been linked, or is (or refers to) an IMPORTED array or IMPORTED non-array data item that has been linked but has been IMPORTED or EXPORTED as READONLY.

