Preprocessor Procedures
A preprocessor procedure is delimited by %PROCEDURE and %END statements. If the procedure is not defined with a RETURNS attribute, then it may not contain ANSWER statements, but it must not contain any RETURN statements. Conversely, if the procedure is a function, then it must contain at least one RETURN statement, and it must not contain any ANSWER statements.
- The preprocessor ANSWER statement
- The preprocessor assignment statement
- The preprocessor CALL statement
- The preprocessor DECLARE statement
- The preprocessor DO-group
- The preprocessor GO TO statement. A GO TO statement appearing in a preprocessor procedure cannot transfer control to a point outside of that procedure.
- The preprocessor IF statement
- The preprocessor ITERATE statement
- The preprocessor LEAVE statement
- The preprocessor null statement
- The preprocessor NOTE statement
- The preprocessor RETURN statement
- The preprocessor SELECT-group
Preprocessor statements in a preprocessor procedure do not begin with a percent symbol.
Preprocessor procedures cannot be nested. A preprocessor ENTRY declaration is not permitted in a preprocessor procedure.
A preprocessor procedure entry name, together with the arguments to the procedure, is called a function reference. A preprocessor procedure can be invoked by a function reference in a preprocessor expression, or, if the function procedure name is active, by encountering a function reference in the preprocessor scan of input text. Preprocessor procedure entry names need not be specified in %DECLARE statements.
- The preprocessor input
- A string included prior to the point of invocation
The value returned by a preprocessor function (that is, the value of the preprocessor expression in the RETURN statement) replaces the function reference and its associated argument list in the preprocessor output.