Error Trapping in Functions
Overview
Most PRO/5 functions allow error trapping (ERR= option) at the function level. PRO/5 takes this branch if an error occurs anywhere inside the parentheses surrounding the arguments.
Description
A function may be used inside a function as shown in the example below:
LET A$=STR(NUM(B$,ERR=1000)/X,ERR=2000)
In this example, a branch is taken to line 1000, if an error occurs within the parentheses for the NUM() function. If an error occurs while the STR() function executes, the branch goes to line 2000. If the NUM() function did not have an ERR= option, any error occurring within its parentheses would be trapped by the ERR=2000 for the STR() function.