Intermec PB31 Fingerprint Developer's Guide (old) - Page 76

Redirecting Output to a File, Output to Sequential Files, Using an OPEN Statement

Page 76 highlights

Chapter 4 - Managing Input and Output Redirecting Output to a File Some Fingerprint commands return data on the standard OUT channel by default. However, it is possible to redirect such output to a file using a REDIRECT OUT statement. When a REDIRECT OUT statement is issued with an appending string expression (REDIRECT OUT ), the expression specifies the name of a sequential file in which the output is stored. In this case no data is echoed back to the host. When no file name appends the statement, the output is directed back to the standard OUT channel. In the following example, the output is redirected to the file "IMAGES.DAT". The images in the printer memory are read to the file, after which the output is redirected back to the standard OUT channel. Then the file is copied to the communication channel "uart1:" and printed on the screen of the host: 10 REDIRECT OUT "IMAGES.DAT" 20 IMAGES 30 REDIRECT OUT RUN Ok Output to Sequential Files This section describes the commands you use in connection with output to sequential files. Using an OPEN Statement Before any data can be written to a sequential file, it must be opened. Use the OPEN statement to specify the name of the file and the mode of access (OUTPUT or APPEND). • OUTPUT means that existing data is replaced. • APPEND means that new data is appended to existing data. In the OPEN statement you must also assign a number to the OPENed file, which is used when the file is referred to in other instructions. The number mark (#) is optional. Optionally, the length of the record can also be changed (default is 128 bytes). Up to 10 files and devices can be open at the same time. In this example, the file "ADDRESSES" is opened for output and given the reference number 1: OPEN "ADDRESSES" FOR OUTPUT AS #1 In this example, the file "PRICELIST" is opened for appended data and is given the reference number 5: OPEN "PRICELIST" FOR APPEND AS #5 60 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
60
Intermec Fingerprint Developer’s Guide
Redirecting Output to a File
Some Fingerprint commands return data on the standard OUT channel by default.
However, it is possible to redirect such output to a file using a REDIRECT OUT
statement.
When a REDIRECT OUT statement is issued with an appending string expression
(REDIRECT OUT <
sexp
>), the expression specifies the name of a sequential file in
which the output is stored. In this case no data is echoed back to the host.
When no file name appends the statement, the output is directed back to the
standard OUT channel.
In the following example, the output is redirected to the file “IMAGES.DAT”. The
images in the printer memory are read to the file, after which the output is
redirected back to the standard OUT channel. Then the file is copied to the
communication channel “uart1:” and printed on the screen of the host:
10
REDIRECT OUT “IMAGES.DAT”
20 IMAGES
30
REDIRECT OUT
RUN
Ok
Output to Sequential Files
This section describes the commands you use in connection with output to
sequential files.
Using an OPEN Statement
Before any data can be written to a sequential file, it must be opened. Use the OPEN
statement to specify the name of the file and the mode of access (OUTPUT or
APPEND).
OUTPUT means that existing data is replaced.
APPEND means that new data is appended to existing data.
In the OPEN statement you must also assign a number to the OPENed file, which is
used when the file is referred to in other instructions. The number mark (#) is
optional. Optionally, the length of the record can also be changed (default is 128
bytes). Up to 10 files and devices can be open at the same time.
In this example, the file “ADDRESSES” is opened for output and given the reference
number 1:
OPEN “ADDRESSES” FOR OUTPUT AS #1
In this example, the file “PRICELIST” is opened for appended data and is given the
reference number 5:
OPEN “PRICELIST” FOR APPEND AS #5