/MACRO_SYNTAX_Definitions

Statements for defining macros.

/MACRO/SYNTAX/Definitions/MACRO

Defining a macro.

A .kumac file may contain several macros. An individual macro has the form

MACRO macro-name [ parameter-list ] statements RETURN

Each statement is either a command line or one of the macro constructs described in this section (MACRO/SYNTAX). For the first macro in the file the MACRO header can be omitted. For the last macro in the file the RETURN trailer may be omitted. Therefore a .kumac file containing only commands (like the LAST.KUMAC) already constitutes a valid macro.

/MACRO/SYNTAX/Definitions/RETURN

Ending a macro definition

RETURN [ value ]

The RETURN statement flags the end of the macro definition and not the end of macro execution, i.e., the construct

IF ... THEN RETURN | error! ENDIF

is illegal. See MACRO/SYNTAX/EXITM.

The value is stored into the variable [@] in the calling macro. If no value is given it defaults to zero.

/MACRO/SYNTAX/Definitions/EXITM

Terminate macro execution and return to calling macro.

EXITM [ value ]

In order to return from a macro prematurely the EXITM statement must be used. The value is stored into the variable [@] in the calling macro. If no value is given it defaults to zero.

/MACRO/SYNTAX/Definitions/STOPM

Terminate macro execution and return to command line prompt.

STOPM

The STOPM statement unwinds nested macro calls and returns to the command line prompt.

/MACRO/SYNTAX/Definitions/ENDKUMAC

Ignore rest of KUMAC file.

A logical "end of file" marker. The KUIP parser will not read any part of a .kumac file which appears after the "ENDKUMAC" command.