IRQ_COMP

Compile a quality expression

Description:

All the quality names referenced in the given quality expression (QEXP) are identified. If all quality names referenced in QEXP are defined within the NDF specified in LOCS, then the quality expression is ‘compiled , i.e. converted into a form that can be used by IRQ_SBADx. The compiled quality expression is identified by the returned IRQ identifier which should be released using IRQ_ANNUL when no longer needed. If any error is reported, then IRQ is returned set to the value IRQ__NOID.

If any quality names referenced in the quality expression are not defined in the NDF specified by LOCS, they are returned in UNDEF, the number of such undefined quality names is returned in NUNDEF, an error is reported and STATUS is returned with value IRQ__NOQNM. Additionally, if INFO is true, then a message is generated identifying each undefined quality name.

If any of the STATUS values IRQ__BADSY, IRQ__MSOPT or IRQ__MSOPD are returned (all of which correspond to various forms of syntax error in the quality expression, see ID6 appendix E), a pointer to the approximate position of the error within the quality expression is returned in ERRPNT.

Invocation

CALL IRQ_COMP( LOCS, SIZE, INFO, QEXP, UNDEF, NUNDEF, ERRPNT, IDQ, STATUS )

Arguments

LOCS(5) = CHARACTER ( ) (Given)
An array of five HDS locators. These locators identify the NDF and the associated quality name information. They should have been obtained using routine IRQ_FIND or routine IRQ_NEW.
SIZE = INTEGER (Given)
The size of the UNDEF array. This should be at least equal to the value of the symbolic constant IRQ__QNREF
INFO = LOGICAL (Given)
If set to .TRUE., then messages are produced identifying any undefined quality names.
QEXP = CHARACTER() (Given and Returned)
A quality expression. See ID6 section 5 for details of the allowed formats for quality expressions. On exit, the string is converted to upper case and any leading blanks are removed.
UNDEF( SIZE ) = CHARACTER ( ) (Returned)
An array holding any undefined quality names referenced in the quality expression. The array should have at least IRQ__QNREF elements, each element being a string of length IRQ__SZQNM.
NUNDEF = INTEGER (Returned)
The number of undefined quality names referenced in the quality expression.
ERRPNT = INTEGER (Returned)
If any of the STATUS values IRQ__BADSY( " Unrecognised logical operator or constant" ), IRQ__MSOPT ( " Missing operator" ) or IRQ__MSOPD ( " Missing operand" ) are returned, then ERRPNT returns the offset within the quality expression at which the error was detected. Note, the offset refers to the returned form of QEXP, not the given form. These will be different if the given form of QEXP has any leading blanks. An offset of zero is returned if none of the errors associated with the above STATUS values occur.
IDQ = INTEGER (Returned)
An IRQ identifier for the compiled quality expression. This identifier can be passed to IRQ_SBADx. This identifier should be annulled using routine IRQ_ANNUL or IRQ_CLOSE when it is no longer needed. If an error is reported, then an invalid identifier (equal to IRQ__NOID) is returned.
STATUS = INTEGER (Given and Returned)
The global status.