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

Commands for Transferring Files Between Printers, Checking Transferred Files With CHECKSUM

Page 54 highlights

Chapter 3 - Managing Files 2-element string array (requires no DIM stmt) Element 0 returns: Type of protocol: "KERMIT" or "ZMODEM" Element 1 returns: Last file name received Example: 10 TRANSFER KERMIT "R" 20 DIM A%(4) 30 TRANSFER STATUS A%,B$ 40 PRINT A%(0), A%(1), A%(2), A%(3), A%(4) 50 PRINT B$(0), B$(1) RUN Commands for Transferring Files Between Printers If you want to transfer a file from one printer to another printer, start by transferring the file to the host. Then disconnect the first printer and download the file to the second printer (or have the two printers connected to separate serial ports). After the transfer, check if the transfer was successful by comparing the result of CHECKSUM functions on both printers. Checking Transferred Files With CHECKSUM Calculate the CHECKSUM on the program in the transmitting printer before the transfer. After the transfer is completed, LOAD the program in the receiving printer and perform the same calculation. If the checksums are identical, the transfer was successful. Note: Do not confuse CHECKSUM with CSUM. For more information, see "Commands for Working With Arrays" on page 38. In this example, the checksum in the lines 10 to 90,000 of a program is calculated: "DEMO.PRG." LOAD "DEMO.PRG" PRINT CHECKSUM (10,90000) Commands for Working With Arrays Variables containing related data may be organized in arrays. Each value in an array is called an element. The position of each element is specified by a subscript, one for each dimension (maximum 10.) Each array variable consists of a name and a number of subscripts, separated by commas, and enclosed by parentheses, as in this example: ARRAY$(3,3,3) The first time an array is referred to, the number of subscripts in an array variable decides its number of dimensions. The number of elements in each dimension is restricted to four (numbered 0 to 3) by default. There are four commands that are particularly relevant for working with arrays: • DIM specifies the size of an array in regard of elements and dimensions. 38 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 3 — Managing Files
38
Intermec Fingerprint Developer’s Guide
2-element string array (requires no DIM stmt)
Element 0 returns: Type of protocol: “KERMIT” or “ZMODEM”
Element 1 returns: Last file name received
Example:
10 TRANSFER KERMIT “R”
20 DIM A%(4)
30 TRANSFER STATUS A%,B$
40 PRINT A%(0), A%(1), A%(2), A%(3), A%(4)
50 PRINT B$(0), B$(1)
RUN
Commands for Transferring Files Between Printers
If you want to transfer a file from one printer to another printer, start by
transferring the file to the host. Then disconnect the first printer and download the
file to the second printer (or have the two printers connected to separate serial
ports). After the transfer, check if the transfer was successful by comparing the
result of CHECKSUM functions on both printers.
Checking Transferred Files With CHECKSUM
Calculate the CHECKSUM on the program in the transmitting printer before the
transfer. After the transfer is completed, LOAD the program in the receiving printer
and perform the same calculation. If the checksums are identical, the transfer was
successful.
In this example, the checksum in the lines 10 to 90,000 of a program is calculated:
“DEMO.PRG.”
LOAD “DEMO.PRG”
PRINT CHECKSUM (10,90000)
Commands for Working With Arrays
Variables containing related data may be organized in arrays. Each value in an array
is called an element. The position of each element is specified by a subscript, one for
each dimension (maximum 10.) Each array variable consists of a name and a
number of subscripts, separated by commas, and enclosed by parentheses, as in this
example:
ARRAY$(3,3,3)
The first time an array is referred to, the number of subscripts in an array variable
decides its number of dimensions. The number of elements in each dimension is
restricted to four (numbered 0 to 3) by default.
There are four commands that are particularly relevant for working with arrays:
DIM specifies the size of an array in regard of elements and dimensions.
Note:
Do not confuse CHECKSUM with CSUM. For more information, see
“Commands for Working With Arrays” on page 38.