Programming instructions
137
Intermec Fingerprint 6.13 – Programmer's Guide
1. Keyboard, cont'd.
15. PRINTER FUNCTION CONTROL, cont'd.
Key-initiated Branching
What will happen when an enabled key is pressed is decided by an
ON KEY...GOSUB statement, that branches the program execu-
tion to a subroutine, where additional instructions specify the action
to be taken. Refer to chapter 5.8 for further information and
additional program example.
Here is an example of how two keys (<F1> and <F2>) are enabled
and used to branch to different subroutines. The keys are specified
by their id. numbers (10 and 11 respectively):
10 KEY (10) ON: KEY (11) ON
20 ON KEY (10) GOSUB 1000
30 ON KEY (11) GOSUB 2000
40 GOTO 40
50 END
1000 PRINT "You have pressed F1"
1010 RETURN 50
2000 PRINT "You have pressed F2"
2010 RETURN 50
RUN
Audible Key Response
Each time a key is pressed, the printer's beeper will, by default, emit
a short signal (1200 Hz for 0.03 sec). The frequency and duration
of the signal can be globally changed for all keys by means of a KEY
BEEP statement. Obviously, setting the frequency or duration to 0
will turn off the signal for all keys.
Input from Printer's Keyboard
Provided "console:" is OPENed for sequential INPUT, the keys can
be used to enter ASCII characters to the program using the
following instructions:
INPUT# reads a string of data to a variable.
INPUT$ reads a limited number of characters to a
variable.
LINE INPUT# reads an entire line to a variable.
Refer to chapter 7.6 for a table showing the ASCII values that the
various keys generate and for a program example. Note that input
from keyboard does not require any keys to be enabled.
Continued!