ECATCH Statement

The DataBasic ECATCH statement defines the label of the statement to which control should be transferred on receipt of an exception for the current and subsequent code levels. (The exception may be generated automatically by the system or a user via the ETHROW statement.)

Syntax

ECATCH exception-catch-label

Syntax Elements

exception-catch-label

The label of the statement to which control is to be transferred on receipt of an exception from this or a deeper level of the application return stack.

Operation

Within the same code level any subsequent ECATCH statements will redefine the exception catch label to be used on receipt of an exception.

An ECATCH statement will override an ECATCH at an earlier code level, but on return to the earlier code level the previous ECATCH label will become active again.

The defined exception catch label can be manually cleared using the ECLEARCATCH statement within the same code level.

Also, the ECATCH will automatically be cleared whenever control is transferred to the defined catch label on receipt of a system or user exception.

After an exception has been handled, the exception code can be redefined by re-specifying the ECATCH statement if required.

See Also

DataBasic Exception Handler