Figure 3-13. Sample Release Handler - HP TACL Programming Manual

Tandem advanced command language
Table of Contents

Advertisement

If the user presses the BREAK key while the processing loop is running, TACL raises
the _BREAK exception and reinvokes the routine. The #CASE function executes the
_BREAK case, displays a message, and exits. If the user enters anything other than
ADD or SUB, the #CASE in the loop raises _ERROR, and TACL reinvokes the routine;
in this situation, the #CASE function takes the _ERROR path, displays a message, and
exits. To invoke this routine, load the associated file and enter:
command_processor

Figure 3-13. Sample Release Handler

?SECTION command_processor ROUTINE
== Exception handler ==
[#CASE [#EXCEPTION]
|_CALL |
== No action required when first called
|_BREAK|
#OUTPUT BREAK key pressed.
#RESET RESULTS FRAMES
#RETURN
|_ERROR|
#OUTPUT Input error occurred.
#RESET RESULTS FRAMES
#RETURN
] == End CASE
== Beginning of body of routine ==
#FRAME
#PUSH cmd
== Filter predefined exceptions only
#FILTER _BREAK _ERROR
== Processing loop:
[#LOOP |DO|
#SET cmd [#INPUT Enter cmd: ]
[#CASE [cmd]
|ADD|
#OUTPUT ADD
|SUB|
#OUTPUT SUB
|OTHERWISE|
#OUTPUT Invalid command
#RAISE _ERROR
]
== End CASE
|UNTIL| 0 = 1
== (do forever)
]
== End LOOP
#UNFRAME
107365 Tandem Computers Incorporated
runs until invalid command or BREAK key
== Get value from terminal
Developing TACL Routines
Writing an Exception Handler
3–21

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents