NET/MASTER Network Control Language (NCL) Programmer's Guide
Scope and Error Handling
Run-Time Error Handling
7–16 106160 Tandem Computers Incorporated
Scope and Error
Handling
Error handlers are associated with blocks of core statements. Blocks are established by
the DO, FUNCTION, PROCEDURE, and SELECT core statements. The scope of an
error handler is determined by the boundaries of a block. Any block, including nested
blocks to any nesting level, can set up its own routines to handle errors occurring
within the block.
The Scope of Core
Statements
The comments in the following code segments show where a block begins and ends in
a procedure, function, DO group, and SELECT group:
The Scope of the PROCEDURE Core Statement
proc_label: PROCEDURE /* Block begins here */
statement1
statement2
statement3
…
END proc_label /* Block ends here */
The Scope of the FUNCTION Core Statement
func_label: FUNCTION /* Block begins here */
statement1
statement2
statement3
…
END func_label /* Block ends here */
The Scope of the DO Core Statement
…
do_label: DO /* Block begins here */
statement1
statement2
statement3
…
END do_label /* Block ends here */
…
The Scope of the SELECT Core Statement
…
select_label: SELECT
WHEN
expr
THEN
statement1
WHEN
expr
THEN
statement2
WHEN
expr
THEN
statement3
OTHERWISE
statement4
/* Block begins here */
statement5
statement6
…
END select_label /* Block ends here */
…