HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4-: 85
197 !
200 ASSIGN #2 TO "File2b"
210 OFF END #2 !Disables the ON END statement in line 140
220 RETURN
225 !
230 SUB End3
240 PRINT "Reusing File3"
250 POSITION #3;BEGIN
260 SUBEND
OFF ERROR
Execution of the OFF ERROR statement deactivates any ON ERROR statement
that affects the program unit containing the OFF ERROR statement.
Syntax
OFF ERROR
If a program unit executes an OFF ERROR statement and then calls another
program unit, any previous ON ERROR statement is inactive in the called
program unit also.
If the OFF ERROR statement is in a subunit, the last previous ON ERROR
statement is reactivated when control returns to the calling program
unit.
The following program segment illustrates OFF ERROR.
Examples
100 ON ERROR CALL Error
105 I=J/0 !Trapped by line 100 ON ERROR
110 CALL Sub1
120 I=J/0 !Trapped by line 100 ON ERROR
130 END
200 SUB Sub1
210 I=J/0 !Trapped by line 100 ON ERROR
220 OFF ERROR
225 I=J/0 !Not trapped
230 CALL Sub2
240 I=J/0 !Not trapped
300 SUB Sub2
310 I=J/0 !Not trapped
320 CALL Sub3
400 SUB Sub3
410 I=J/0 !Not trapped
420 ON ERROR GOTO 430
425 I=J/0 !Trapped by line 420 ON ERROR
430 PRINT "Error at 425"
440 SUBEND
500 SUB Error
510 PRINT "Error at 105, 120, or 210"
515 I=0
520 SUBEND
OFF HALT
The OFF HALT statement deactivates the currently active ON HALT
statement.
Syntax
OFF HALT
If the OFF HALT statement is in a subunit, it deactivates the currently
active ON HALT statement only while the subunit is executing. Any active
ON HALT statement in the calling program unit is reactivated when control