HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4-: 93
Table 4-9. ON HALT Statements
---------------------------------------------------------------------------------------------
||||
| Statement Selected | Line to Which | Scope of ON HALT |
||Control is Transferred | Statement |
||following ON HALT ||
||processing ||
||||
---------------------------------------------------------------------------------------------
||||
| GOTO
line_id
| None. | Program unit that contains |
| | | it. |
||||
---------------------------------------------------------------------------------------------
||||
| GOSUB
line_id
| Line following the line that | Program unit that contains |
| | was executing when the halt | it. |
| | key was pressed. | |
||||
---------------------------------------------------------------------------------------------
||||
| CALL
sub_id
| Line following the line that | Program unit that contains |
| | was executing when the halt | it and program unit that it |
| | key was pressed. | calls, until called unit |
| | | executes a local ON HALT |
| | | statement or an OFF HALT |
| | | statement. |
||||
---------------------------------------------------------------------------------------------
If you use the CALL option, it cannot have parameters. To achieve the
effect of a CALL with parameters, use the GOSUB form and put the desired
CALL statement at the GOSUB destination.
Examples
10 ON HALT GOSUB 20
20 CALL Sub3 (A,B) !Control goes here if the halt key is pressed.
An ON HALT statement is deactivated by execution of another ON HALT
statement or by an OFF HALT statement.
ON KEY
The ON KEY statement defines a branch that is to be executed when a
specific branch-during-input key is pressed during execution of an HP
Business BASIC/XL input or READ FORM statement.
Syntax
{CALL
subprogram
}
ON KEY
key_number_list
{GOTO
line_id
}
{GOSUB
line_id
}
[{;} ]
[{,} LABEL [=]
key_label
]
[{;} {PRI } ]
[{,} {PRIORITY} [=]
priority_level
]
Parameters
key_number_list
A list of integers selected from the set of [1..8] or
numeric expressions that evaluate to integers in the
range of [1..8] separated by commas or semicolons. This
set indicates which branch-during-input key is to be
trapped. If the integer is not in the specified range,
an error occurs. No more than eight values can be
specified for each statement.