Exception Handling Facilities

The GT.M exception trapping allows you to do the following:

The following table summarizes the GT.M language extensions that facilitate exception handling.

GT.M Exception Handling Extensions

EXTENSION

EXPLANATION

ZGoto

Removes zero or more levels from the M Invocation stack and, optionally, transfers control.

ZMessage

Signals the specified condition.

$ZCSTATUS

Holds the value of the status code for the last compile performed by a ZCOMPILE command.

$ZEOF

Contains indication of whether the last READ reached end-of-file.

$ZMessage()

Translates an error condition code into text form.

$ZLevel

Contains current level of DO/XECUTE nesting.

$ZStatus

Contains error condition code and location of last exception condition occurring during routine execution.

$ZSYstem

Contains the status code of the last ZSYSTEM.

$ZTrap

Contains an XECUTE string or entryref that GT.M invokes upon encountering an exception condition.

EXCEPTION

Provides a deviceparameter specifying an XECUTE string or entryref that GT.M invokes upon encountering a device-related exception condition.