Design: 09.01.11.01/P02

This is an abstract, language-independent design. Grim details may be found in the corresponding source code. You may return to the documentation for the module containing this program design, or to the entire hierarchical table of topics covered by the PVT.


PROGRAM 2: First call <set error handler>

CHARACTERISTICS: nnnn

OPERATOR SCRIPT:
This program uses both system default error handler and application
defined error handler "my_err_hander" which is within this program.
The usual means of invoking PVT programs links in a user-defined error
handler. Be sure to use the special mechanism provided (normally the "phfe"
or "phce" command) for invoking programs without the user-defined error
handler.

DESIGN:
(1) Generates an error using default system error handling subroutine
"perr_hand" which will be written in error file.
(2) Set error handler to "my_err_handler" and return old error handler.
Generates an error.
(3) Set error handler to old error handler, and generates an error which
will be stored in error file.
(4) Rewind error file, read two error messages and compare them to test
if <set error handler> returns system error handler when called first time.

**** **** ****

cur_error=0, cur_function=555

<open phigs>
<text>: signals error
<set error handler> with (my_err_handler, default_err_handler)
<text>: signals error
<set error handler> with (default_err_handler, old_err_handler)
<text>: signals error
TEST: #SR 3
      "<Set error handler> should return default system error handler when
       called first time."

rewind error file
get first error massage from error file and store at mesg1
get second error message from error file and store at mesg2
pass/fail depending of (mesg1 = mesg2)

<close phigs>

END PROGRAM 2