HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
f
8-: 4
Subunits
The ON KEY CALL statement is active in all subunits called by the subunit
that the statement is in unless the user-definable key is redefined
within the called subunit. If the key is redefined, the definition on
exit from the called subunit is restored to the ON KEY call that it had
upon entry. ON KEY GOTO and ON KEY GOSUB are active only within the
subunit that they are in. Similarly, an OFF KEY restores the typing aid
key definitions to those keys specified only for the subunit that the OFF
KEY is in. When you exit from the subunit, the values that the fields
of the keys had upon entry to the subunit are restored. If a
branch-during-input key is pressed within a compiled subunit called from
a program running in the interpreter, the specified branch is added to
the interrupt queue and handled when you return to the interpreter.
Using Function Keys in a Batch Job
Function keys can be used in a batch job, or when standard input is taken
from a disk file. There are some restrictions, however.
The ON KEY and OFF KEY statements are used normally. However, batch jobs
ignore the LABEL specified in the ON KEY statement. Only the action and
the priority are used.
HP Business BASIC/XL always looks for keys from terminal input
statements, such as INPUT and LINPUT. The file input statements do not
expect or examine data for key presses. During batch processing,
however, "terminal" input does come from a file, so HP Business BASIC/XL
must look for key presses in the standard input. To press a key, you
must know how HP Business BASIC/XL recognizes a key.
When input is requested, HP Business BASIC/XL accepts data from the
standard input (BASIN) file until the end of the line occurs. A function
key check is performed immediately, before any blanks are trimmed from
the input line. A function key consists of two characters: an escape
character (ASCII 27) followed by a lower case letter between p and w,
inclusive. (These are the default terminal definitions and represent
function keys 1 to 8 respectively.) To represent a key press, these two
characters must appear as the last two characters in the input data. If
the escape occurs anywhere else in the input, the sequence is part of the
input.
You must exercise caution in creating batch jobs or disk files for HP
Business BASIC/XL with key presses. If fixed format files are used, the
escape sequence must appear as the last two characters of a record.
Otherwise, the escape sequence will not be recognized as a key press. A
sample input file might look like:
The following example shows
Column: Column: Remarks:
0 ...78
1 ...90
------------------------------
this is a test. Data to an INPUT statement.
<esc>p This will be taken as data
.p (. represents <esc>) Press key