Lexmark Dot Matrix Technical Reference - Page 18

Programming Examples

Page 18 highlights

To run the printer test, follow these steps: 1 Make sure the paper and ribbon are installed. 2 Turn the printer Off. 3 Press Line Feed while you turn the printer On. 4 After a few seconds, release Line Feed. To stop or interrupt the printer test: 1 Press Start/Stop. The test stops after a complete line of characters has printed. 2 Press Start/Stop to continue the printer test. Programming Examples Examples in this manual have been formatted to be processed by a simple BASIC program. The BASIC program reads an input file and writes data to an output file. Printer commands may be entered into the input file in a hexadecimal format and enclosed with opening and closing delimiters. The opening delimiter is a less-than symbol, ''. Within the delimiters, hexadecimal data must be presented in two-digit pairs. White space, blanks, carriage returns and line feeds may be used between the pairs. In addition, a comment may be added to the end of a line by using a minus sign, '-', at the start of the comment. All data after a minus sign is ignored until a carriage return or line feed is encountered. The example format used in this book is shown below: All of the examples use this encoding method and have been tested using the following BASIC program: 1000 INPUT "Enter file name to be printed"; FILENAME$ 1010 OPEN FILENAME$ FOR INPUT AS #1 1020 OPEN "prtrout.bin" FOR OUTPUT AS #2 1030 WHILE EOF(1) = 0 1040 I$ = INPUT$(1, #1) 16 Section 1: Introduction

  • 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
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227

Section 1: Introduction
16
To run the printer test, follow these steps:
1
Make sure the paper and ribbon are installed.
2
Turn the printer Off.
3
Press
Line Feed
while you turn the printer On.
4
After a few seconds, release
Line Feed
.
To stop or interrupt the printer test:
1
Press
Start/Stop
. The test stops after a complete line of characters has
printed.
2
Press
Start/Stop
to continue the printer test.
Programming Examples
Examples in this manual have been formatted to be processed by a simple
BASIC program. The BASIC program reads an input file and writes data to an
output file. Printer commands may be entered into the input file in a
hexadecimal format and enclosed with opening and closing delimiters.
The opening delimiter is a less-than symbol,
’<
’, followed by an
’x
’. The
’x
may
be either upper or lower case. The closing delimiter is a greater-than symbol,
’>’
.
Within the delimiters, hexadecimal data must be presented in two-digit pairs.
White space, blanks, carriage returns and line feeds may be used between the
pairs. In addition, a comment may be added to the end of a line by using a
minus sign,
’-
’, at the start of the comment. All data after a minus sign is ignored
until a carriage return or line feed is encountered.
The example format used in this book is shown below:
All of the examples use this encoding method and have been tested using the
following BASIC program:
1000 INPUT "Enter file name to be printed"; FILENAME$
1010 OPEN FILENAME$ FOR INPUT AS #1
1020 OPEN "prtrout.bin" FOR OUTPUT AS #2
1030 WHILE EOF(1) = 0
1040
I$ = INPUT$(1, #1)
<x
1B36
-
select character set 2
1B5B0400000001B5
-
select code page 437
1B5B640100A0
-
set print quality to letter quality
1B5B4905000055007801
-
set font global to Courier 12
>