HPlogo Command Interpreter Access and Variables Programmer's Guide: Series HP 3000 Computer Systems > Chapter 7 Sample Command Files

To Set a Function Key

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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.)

Figure 7-3 Function Key Command File

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 **

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:

Figure 7-4 FKEY Sample Output

:echo this is a test

this is a test
Feedback to webmaster