Intermec PB32 Fingerprint Developer's Guide (old) - Page 30

Using Line Numbers, Programming Without Line Numbers, Understanding Fingerprint Syntax

Page 30 highlights

Chapter 2 - Understanding Fingerprint Syntax Using Line Numbers You can manually enter line numbers as you write program lines. Intermec recommends that you start with line number 10 and use an increment of 10 between lines to allow additional lines to be inserted later if necessary. To make the program easier to read, you can use a space character between the line number and the instruction. If you do not use a space, Fingerprint automatically inserts a space character when the program is listed. The next example shows a short program with line numbers: 10 PRPOS 200,200 20 DIR 3 30 ALIGN 5 40 PRIMAGE "GLOBE.1" 50 PRINTFEED RUN The last line has no line number, and contains the RUN command plus a carriage return. This orders the printer to execute all preceding lines in consecutive ascending order according to their line numbers. In this manual, the programming examples will generally have line numbers in order to make them easier to understand. For more complex programs, programming without line numbers may be both easier and quicker as described in the next section. Programming Without Line Numbers To write program lines without manually entering line numbers, send the IMMEDIATE OFF command first. Then you can write the program line by line without having to type a line number at the start of each line. In other respects, you can generally work just as when using line numbers. To make the execution branch to a certain line, such as a GOTO statement, the line to branch to must start with a line label, which is a string of characters appended by a colon (:). The line label must not start with a digit or interfere with any keywords reserved by Fingerprint. To branch to a line marked with a line label, just enter the line label (without the colon). Finish the program by sending an IMMEDIATE ON command before you RUN it. The lines will automatically be numbered 10-20-30-40-50, and so on, but the line numbers are not visible until you LIST the program. Line labels are not replaced by line numbers. The next example shows how line labels are used in a simple program: IMMEDIATE OFF GOSUB Q123 END Q123:SOUND 440,50 RETURN IMMEDIATE ON RUN If you next send the LIST command, Fingerprint automatically adds the line numbers: 14 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
14
Intermec Fingerprint Developer’s Guide
Using Line Numbers
You can manually enter line numbers as you write program lines. Intermec
recommends that you start with line number 10 and use an increment of 10 between
lines to allow additional lines to be inserted later if necessary. To make the program
easier to read, you can use a space character between the line number and the
instruction. If you do not use a space, Fingerprint automatically inserts a space
character when the program is listed.
The next example shows a short program with line numbers:
10
PRPOS 200,200
20
DIR 3
30
ALIGN 5
40
PRIMAGE “GLOBE.1”
50 PRINTFEED
RUN
The last line has no line number, and contains the RUN command plus a carriage
return. This orders the printer to execute all preceding lines in consecutive
ascending order according to their line numbers.
In this manual, the programming examples will generally have line numbers in
order to make them easier to understand. For more complex programs,
programming without line numbers may be both easier and quicker as described in
the next section.
Programming Without Line Numbers
To write program lines without manually entering line numbers, send the
IMMEDIATE OFF command first. Then you can write the program line by line
without having to type a line number at the start of each line. In other respects, you
can generally work just as when using line numbers.
To make the execution branch to a certain line, such as a GOTO statement, the line
to branch to must start with a line label, which is a string of characters appended by
a colon (:). The line label must not start with a digit or interfere with any keywords
reserved by Fingerprint. To branch to a line marked with a line label, just enter the
line label (without the colon).
Finish the program by sending an IMMEDIATE ON command before you RUN it.
The lines will automatically be numbered 10-20-30-40-50, and so on, but the line
numbers are not visible until you LIST the program. Line labels are not replaced by
line numbers.
The next example shows how line labels are used in a simple program:
IMMEDIATE OFF
GOSUB Q123
END
Q123:SOUND 440,50
RETURN
IMMEDIATE ON
RUN
If you next send the LIST command, Fingerprint automatically adds the line
numbers: