Figure 3-14. Returning Information From A Release Handler - HP TACL Programming Manual

Tandem advanced command language
Table of Contents

Advertisement

Developing TACL Routines
Writing an Exception Handler
3–22
When you invoke command_processor, the output looks like this:
16> command_processor
Enter cmd: add
ADD
Enter cmd: clr
Invalid command
TACL error occurred.
17> command_processor
Enter cmd: <BREAK>
BREAK key pressed.
18>
Use the routine in Figure 3-14, purgefiles, to purge files based on file name
templates. Purgefiles illustrates the use of #FILTER, #FILENAMES, and the
TEMPLATES alternative for the #ARGUMENT built-in function. To use this routine,
load the associated file and enter:
purgefiles [ ! ] file-template [ , file-template ] ...
The ! specifies purge without confirmation; without it, the routine prompts for each
file. If the routine encounters a _BREAK exception, it displays a message with the
number of files purged and the number not purged, and then exits.
Figure 3-14. Returning Information From a Release Handler (Page 1 of 3)
?SECTION purgefiles ROUTINE
[#CASE [#EXCEPTION]
|_CALL|
|_BREAK _ERROR|
#PUSH errtext
#ERRORTEXT /CAPTURE errtext/
#OUTPUT Break or error terminated function.
#OUTPUT
[#IF NOT [#EMPTYV /BLANK/ errtext] |THEN|
#OUTPUTV errtext
#OUTPUT
]
#OUTPUT Number of files purged = [filespurged]
#OUTPUT Number of files not purged = [filesnotpurged]
#UNFRAME
#RETURN
]
#FRAME
== Filter _BREAK and TACL errors
#FILTER _BREAK _ERROR
[#PUSH filetemplate exclude prevname purgeerr opt firsttime
filespurged filesnotpurged
]
107365 Tandem Computers Incorporated

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents