To Suppress Linefeed, OPEN "lpt1" BINARY or "LPT1: BIN" RANDOM (35244)
This article was previously published under Q35244
SUMMARY
When the LPRINT statement sends CHR$(13) (a carriage return) to the
printer, it automatically adds a linefeed, CHR$(10). This automatic
linefeed prevents the ability to overtype or underline a previously
printed line.
The following methods let you suppress the automatic linefeed, as
shown in complete programs further below:
- OPEN "LPT1:BIN" FOR RANDOM AS #n
WIDTH#n,255
- OPEN "lpt1" FOR BINARY #n
[Note that this method requires the "lpt1" device name to have
no colon (:).]
These methods should also be used if you want to send control
characters to your printer, such as for printer-graphics mode.
Otherwise, the programs below can create garbled graphics output [e.g.
the extra linefeed is printed after byte values of 13, and ASCII
values of 9 (horizontal tab) are converted to 8 spaces].
This information applies to Microsoft QuickBasic Versions 4.00, 4.00b,
and 4.50 for MS-DOS, to Microsoft Basic Compiler Versions 6.00 and
6.00b for MS-DOS and MS OS/2, and to Microsoft Basic PDS Version 7.00
for MS-DOS and MS OS/2.
Modification Type: |
Minor |
Last Reviewed: |
1/8/2003 |
Keywords: |
KB35244 |
|