Intermec PB51 Fingerprint Developer's Guide (old) - Page 36

Using an ON COMSET...GOSUB Instruction, Using an ON KEY...GOSUB Instruction

Page 36 highlights

Chapter 2 - Understanding Fingerprint Syntax Using an ON COMSET...GOSUB Instruction When one of several specified conditions interrupts the background communication on a certain communication channel, the program branches to a subroutine, such as reading the buffer. The interrupt conditions (end character, attention string, or maximum number of characters) are specified by a COMSET statement as in this example: 1 10 20 30 40 50 60 1000 2000 2010 2020 2030 REM Exit program with #STOP& COMSET1,"#","&","ZYX","=",50 ON COMSET 1 GOSUB 2000 COMSET 1 ON IF A$ "STOP" THEN GOTO 40 COMSET 1 OFF END END A$= COMBUF$(1) PRINT A$ COMSET 1 ON RETURN Using an ON KEY...GOSUB Instruction To use the printer keypad, each key can be enabled individually using a KEY ON statement and assigned to a subroutine using an ON KEY GOSUB statement. The subroutine should contain the instructions you want performed when the key is pressed. In the statements KEY () ON, KEY () OFF, and ON KEY () GOSUB..., the keys are specified by id. numbers enclosed by parentheses. For more information, see "Using the Printer Keypad" on page 111. Note that ON KEY...GOSUB excludes data input from the printer keypad. This example shows how the two unshifted keys F1 (id. No. 10) and F2 (id. No. 11) are used to change the printer contrast. 10 20 30 40 50 60 70 80 90 100 110 120 1000 1010 1020 2000 2010 2030 RUN PRPOS 100,500 PRLINE 100,100 FONT "Swiss 721 BT" PRPOS 100,300 MAG 4,4 PRTXT "SAMPLE" ON KEY (10) GOSUB 1000 ON KEY (11) GOSUB 2000 KEY (10) ON : KEY (11) ON GOTO 70 PRINTFEED END SETUP "MEDIA,CONTRAST,-10%" PRPOS 100,100 : PRTXT "Weak Print" RETURN 110 SETUP "MEDIA,CONTRAST,10%" PRPOS 100,100 : PRTXT "Dark Print" RETURN 110 20 Intermec Fingerprint Developer's Guide

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187

Chapter 2 — Understanding Fingerprint Syntax
20
Intermec Fingerprint Developer’s Guide
Using an ON COMSET...GOSUB Instruction
When one of several specified conditions interrupts the background
communication on a certain communication channel, the program branches to a
subroutine, such as reading the buffer. The interrupt conditions (end character,
attention string, or maximum number of characters) are specified by a COMSET
statement as in this example:
1
REM Exit program with #STOP&
10
COMSET1,“#”,“&”,“ZYX”,“=”,50
20
ON COMSET 1 GOSUB 2000
30
COMSET 1 ON
40
IF A$ <> “STOP” THEN GOTO 40
50
COMSET 1 OFF
60
END
1000 END
2000
A$= COMBUF$(1)
2010
PRINT A$
2020
COMSET 1 ON
2030 RETURN
Using an ON KEY...GOSUB Instruction
To use the printer keypad, each key can be enabled individually using a KEY ON
statement and assigned to a subroutine using an ON KEY GOSUB statement. The
subroutine should contain the instructions you want performed when the key is
pressed.
In the statements KEY (<id.>) ON, KEY (<id.>) OFF, and ON KEY (<id.>) GOSUB...,
the keys are specified by id. numbers enclosed by parentheses. For more
information, see
“Using the Printer Keypad” on page 111.
Note that ON KEY...GOSUB excludes data input from the printer keypad.
This example shows how the two unshifted keys
F1
(id. No. 10) and
F2
(id. No. 11)
are used to change the printer contrast.
10
PRPOS 100,500
20
PRLINE 100,100
30
FONT “Swiss 721 BT”
40
PRPOS 100,300
50
MAG 4,4
60
PRTXT “SAMPLE”
70
ON KEY (10) GOSUB 1000
80
ON KEY (11) GOSUB 2000
90
KEY (10) ON : KEY (11) ON
100
GOTO 70
110
PRINTFEED
120
END
1000
SETUP “MEDIA,CONTRAST,-10%”
1010
PRPOS 100,100 : PRTXT “Weak Print”
1020
RETURN 110
2000
SETUP “MEDIA,CONTRAST,10%”
2010
PRPOS 100,100 : PRTXT “Dark Print”
2030
RETURN 110
RUN