TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-179
#FILTER Built-In Function
#FILTER Built-In Function
Use #FILTER in a routine to specify the exceptions the routine can handle. An
exception is an unusual event that causes TACL to interrupt the normal flow of
invocations and transfer to special code, known as an exception handler. The event
can be BREAK, a TACL error, or a user-defined exception.
exception
is the name of an unusual event, which can be any of these:
_BREAK
specifies that the BREAK key is to be handled as an exception, when pressed.
_ERROR
specifies that errors detected by TACL are to be handled. In addition, your
code can explicitly raise this exception.
user-exception
specifies a user-defined routine that can be invoked by #RAISE, causing the
routine that handles #FILTER to be reinvoked and to set #EXCEPTION to
user-exception.
Result
#FILTER returns nothing.
Considerations
A portion of a TACL program that performs the actions required by one or more
exceptions is known as an exception handler. An exception handler must do the
following, within a routine:
°
Include a #CASE built-in function call to handle each of the exceptions the
handler supports. The #EXCEPTION built-in function returns the type of
exception that invoked the handler; use it to direct the #CASE function.
°
Specify names of exceptions supported by the handler. For this step, use the
#FILTER built-in function to specify the exceptions. TACL does not invoke an
exception handler for an exception unless it is listed in the #FILTER list.
If your code contains these two items and an exception occurs while one of your
functions is executing, the TACL process will invoke the #EXCEPTION built-in function
with the name of the exception that occurred.
#FILTER [ exception [ exception ] ... ]