HP 3000 Manuals

To Set a Function Key [ Command Interpreter Access and Variables Programmer's Guide ] MPE/iX 5.0 Documentation


Command Interpreter Access and Variables Programmer's Guide

To Set a Function Key 

The FKEY command file sets a single function key.  It demonstrates
setting escape sequences with string concatenation and variable
dereferencing.

Parameter input defines the key to be set by the command file (KEY), the
label (L1), the string to be generated when the function key is pressed
(S1), and the key attribute parameter (A1).  The possible entries for the
key attribute parameter are:

       0 = NORMAL

       1 = LOCAL

       2 = TRANSMIT

The commands contained in FKEY are provided in the following example.
(Note that an ampersand is used to continue a lengthy command on a second
line.  The CI will concatenate the first and second lines to execute the
command.)
______________________________________________
|                                            |
|     PARM KEY,L1=" ",S1=" ",A1=2            |
|     IF HPJOBTYPE="S" AND HPDUPLICATIVE THEN|
|       ECHO ![CHR(27)]&f!"A1"a!"KEY"k&      |
|            ![LEN"!L1"]d![LEN("!S1")]L!L1!S1|
|       ECHO ![CHR(27)]&jB                   |
|     ENDIF                                  |
|     COMMENT ** END OF FKEY **              |
______________________________________________

          Figure 7-3.  Function Key Command File 

To set the F1 key to perform a test and display a message, the following
command string would be entered.

     FKEY 1,test,'echo this is a test'

Once the command string has been entered, pressing the F1 key results in
the following display:
_______________________________________
|                                     |
|                                     |
|      :echo this is a test           |
|      this is a test                 |
|                                     |
_______________________________________

          Figure 7-4.  FKEY Sample Output 



MPE/iX 5.0 Documentation