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

Using a CLOSE Statement, Finding the Last Field Read and Determining File Length With LOC and LOF

Page 80 highlights

Chapter 4 - Managing Input and Output Using a CLOSE Statement When you are finished, close the file: 100 CLOSE #1 Nothing actually happens before you execute the program using a RUN statement. Then the data is placed into the fields and records as specified by the program, as in this example: 10 OPEN "ZFILE" AS #1 LEN=14 20 FIELD#1, 4 AS F1$, 4 AS F2$, 6 AS F3$ 30 QDATA1$="ABC" 40 QDATA2$="DEF" 50 QDATA3$="12345678" 60 LSET F1$=QDATA1$ 70 RSET F2$=QDATA2$ 80 LSET F3$=QDATA3$ 90 PUT #1,1 100 CLOSE #1 RUN Finding the Last Field Read and Determining File Length With LOC and LOF Use LOC to return the number of the last record read by the use of GET statement. For an example, see "Finding the Last Field Read With LOC" on page 51. LOF returns the length (in bytes) of a file that has been opened. For an example, see "Determining File Length With LOF" on page 49. Output to Communication Channels Output from a Fingerprint program can be directed to any serial communication channel OPENed for sequential OUTPUT following the same principles as for output to files. For more information, see "Output to Sequential Files" on page 60. Note: In this case, the "centronics:" channel cannot be used. These Fingerprint commands are used in connection with output to a communication channel: • OPEN • PRINT# • PRINTONE# • CLOSE • LOC • LOF • COPY 64 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 4 — Managing Input and Output
64
Intermec Fingerprint Developer’s Guide
Using a CLOSE Statement
When you are finished, close the file:
100
CLOSE #1
Nothing actually happens before you execute the program using a RUN statement.
Then the data is placed into the fields and records as specified by the program, as in
this example:
10
OPEN “ZFILE” AS #1 LEN=14
20
FIELD#1, 4 AS F1$, 4 AS F2$, 6 AS F3$
30
QDATA1$=“ABC”
40
QDATA2$=“DEF”
50
QDATA3$=“12345678”
60
LSET F1$=QDATA1$
70
RSET F2$=QDATA2$
80
LSET F3$=QDATA3$
90
PUT #1,1
100
CLOSE #1
RUN
Finding the Last Field Read and Determining File Length With LOC
and LOF
Use LOC to return the number of the last record read by the use of GET statement.
For an example, see
“Finding the Last Field Read With LOC” on page 51.
LOF returns the length (in bytes) of a file that has been opened. For an example, see
“Determining File Length With LOF” on page 49.
Output to Communication Channels
Output from a Fingerprint program can be directed to any serial communication
channel OPENed for sequential OUTPUT following the same principles as for
output to files. For more information, see
“Output to Sequential Files” on
page 60.
These Fingerprint commands are used in connection with output to a
communication channel:
OPEN
PRINT#
PRINTONE#
CLOSE
LOC
LOF
COPY
Note:
In this case, the “centronics:” channel cannot be used.