HP 3000 Manuals

Using Function Keys in a Batch Job [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

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



MPE/iX 5.0 Documentation