Intermec PM43/PM43c Fingerprint Developer's Guide (PC23d, PC43d/t, PM23c, PM43 - Page 71

Printing Expressions to a Sequential File With PRINT#

Page 71 highlights

Chapter 4 - Managing Input and Output Printing Expressions to a Sequential File With PRINT# PRINT# prints data entered as string or numeric expressions to a sequential file. For more information, see "Printing Expressions With PRINT" on page 56. There are two ways to divide the file into records: • Each PRINT# statement creates a new record as seen in lines 20-40 in the example. • Commas inside a string divide the string into records, as seen in line 50 in the example. Example: 10 OPEN "QFILE" FOR OUTPUT AS #1 20 PRINT #1, "Record A", "a", "b", "c" 30 PRINT #1, "Record B", 1, 2, 3 40 PRINT #1, "Record C", "x"; "y"; "z" 50 PRINT #1, "Record D,Record E,Record F" Printing Characters by ASCII Values With PRINTONE# The PRINTONE# statement prints characters entered as decimal ASCII values according to the selected character set to the selected file or device. For more information, see "Printing Characters by ASCII Values With PRINTONE" on page 57. This example prints two records ("Hello" and "Goodbye") to "FILE1": 10 OPEN "FILE1" FOR OUTPUT AS 55 20 PRINTONE#55,72;101;108;108;111 30 PRINTONE#55,71;111;111;100;98;121;101 Using a CLOSE Statement After writing data to the file, close it using the same reference number as when it was opened, as in this example: 10 OPEN "FILE1" FOR OUTPUT AS 55 20 PRINTONE#55,72;101;108;108;111 30 PRINTONE#55,71;111;111;100;98;121;101 40 CLOSE 55 Counting Data Blocks and Determining File Length With LOC and LOF Use LOC to return the number of 128-byte blocks that have been written since the file was opened. For an example, see "Counting Data Blocks with LOC" on page 47. LOF returns the length (in bytes) of a file that has been opened. For an example, see "Determining File Length with LOF" on page 47. Fingerprint Developer's Guide 59

  • 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

Chapter 4 — Managing Input and Output
Fingerprint Developer’s Guide
59
Printing Expressions to a Sequential File With PRINT#
PRINT# prints data entered as string or numeric expressions to a sequential file. For
more information, see
“Printing Expressions With PRINT” on page 56
.
There are two ways to divide the file into records:
Each PRINT# statement creates a new record as seen in lines 20-40 in the
example.
Commas inside a string divide the string into records, as seen in line 50 in the
example.
Example:
10
OPEN “QFILE” FOR OUTPUT AS #1
20
PRINT #1, “Record A”, “a”, “b”, “c”
30
PRINT #1, “Record B”, 1, 2, 3
40
PRINT #1, “Record C”, “x”; “y”; “z”
50
PRINT #1, “Record D,Record E,Record F”
Printing Characters by ASCII Values With PRINTONE#
The PRINTONE# statement prints characters entered as decimal ASCII values
according to the selected character set to the selected file or device. For more
information, see
“Printing Characters by ASCII Values With PRINTONE” on
page 57
.
This example prints two records (“Hello” and “Goodbye”) to “FILE1”:
10
OPEN “FILE1” FOR OUTPUT AS 55
20
PRINTONE#55,72;101;108;108;111
30
PRINTONE#55,71;111;111;100;98;121;101
Using a CLOSE Statement
After writing data to the file, close it using the same reference number as when it was
opened, as in this example:
10
OPEN “FILE1” FOR OUTPUT AS 55
20
PRINTONE#55,72;101;108;108;111
30
PRINTONE#55,71;111;111;100;98;121;101
40
CLOSE 55
Counting Data Blocks and Determining File Length With LOC and
LOF
Use LOC to return the number of 128-byte blocks that have been written since the
file was opened. For an example, see
“Counting Data Blocks with LOC” on
page 47
.
LOF returns the length (in bytes) of a file that has been opened. For an example, see
“Determining File Length with LOF” on page 47
.