NET/MASTER Network Control Language (NCL) Programmer's Guide
Scope and Error Handling
Run-Time Error Handling
7–18 106160 Tandem Computers Incorporated
Scope and Searching for an
Error Handler
Scope affects how NCL searches for an error handler from any point. When NCL
searches for an error handler, it does so in the following way:
1. It looks for a specific error handler within its current block.
2. If it cannot find one, it progressively looks for one, in nested order, in all outer
blocks. The last block it searches is the block at the open code level of the current
procedure or function.
3. If it cannot find one and if the current procedure or function was called by another
procedure or function, it continues the search in the caller. It begins at the current
execution point of the caller, and searches according to Steps 1, 2, and 3.
4. If it cannot find a specific error handler by the time it reaches the top level
procedure, it looks for the general error handler—ERROR. NCL begins the search
again according to Steps 1, 2, and 3 looking for the general error handler.
5. If it cannot find a general error handler, by the time it reaches the top level
procedure, the default system action is taken. This normally terminates the NCL
process.
At any point, if NCL finds the error handler for which it is looking, it passes control to
it.
Figure 7-1 illustrates the search order from block to block, beginning at block 1 and
continuing through to block 6. In this case, multiple procedures or functions have
been called.