Writing an Exception Handler
Developing TACL Routines
107365 Tandem Computers Incorporated
3–23
Figure 3-14. Returning Information From a Release Handler (Page 2 of 3)
[#DEF wanttopurge ROUTINE |BODY|
#RESULT -1
[#IF [exclude] |THEN|
#RETURN
]
[#IF [#MATCH y [#INPUT Purge [prevname] (Y/N)?]] |THEN|
#RETURN
]
#RESET results
#RESULT 0
] == end #DEF wanttopurge
[#DEF handletemplate MACRO |BODY|
#SET firsttime 0
[#IF ([#ARGUMENT SLASH OTHERWISE] = 1) |THEN|
[#IF [#ARGUMENT KEYWORD /WORDLIST start/]]
[#IF [#ARGUMENT /VALUE prevname/ FILENAME /SYNTAX/]]
[#IF [#ARGUMENT SLASH]]
#SET prevname [#FILEINFO /FULLNAME/ [prevname]]
#SET firsttime -1
]
[#LOOP |DO|
[#IF [firsttime] |THEN|
#SET firsttime [#FILEINFO /EXISTENCE/ [prevname]]
]
[#IF [firsttime] |THEN|
#SET firsttime 0
|ELSE|
#SET prevname [#FILENAMES /MAXIMUM 1, &
PREVIOUS [prevname]/ [filetemplate]]
]
[#IF NOT [#EMPTYV /BLANK/ prevname] |THEN|
[#IF [wanttopurge] |THEN|
#SET purgeerr [#PURGE [prevname]]
[#IF [purgeerr] |THEN|
#OUTPUT Purge error [purgeerr] on [prevname]
#SET filesnotpurged [#compute filesno1]
|ELSE|
#OUTPUT [prevname] purged
#SET filespurged [#COMPUTE files 1]
]
|ELSE|
#SET filesnotpurged [#COMPUTE filesnot 1]
]
]
|UNTIL| [#EMPTYV /BLANK/ prevname]
] == end #LOOP
] == end #DEF