OKI ML3390 01091308*01256402 用户手册

产品代码
01091308*01256402
下载
页码 349
Chapter 11: IBM - Graphics
11-6
Programming
graphics
When entering the program
lines beginning with REM
can be left out and the DATA
instructions compiled in
longer lines.
When programming graphics, do not add superfluous line feed
commands. If you enter a semicolon after the data transferred in an
LPRINT instruction, the print head will remain in the respective
line.
Remember in addition that BASIC assigns to all printers a maxi-
mum line length of 80 characters. After receiving the data of 80 data
bytes, a carriage return with line feed is sent automatically to the
printer. Since graphics normally consist of a large number of bytes,
this limit is soon exceeded and the image in question is printed out
incorrectly. You can get around this problem by setting the line
length to the maximum permissible value of 255. To do this, enter
one of the following instructions at the beginning of your program:
For parallel printers:
WIDTH "LPT1:",255
For printers with serial interface which have been opened as #1:
WIDTH #1,255
Example:
10
REM 24-pin graphics demo program IBM
ProPrinter X(L) 24
 20
OPEN “lpt1:bin” FOR OUTPUT AS #1:
WIDTH “lpt1:”, 255: REM Prepare for output
30
FOR MODE = 1 TO 4
40
IF MODE = 1 THEN PRINT #1, “24 pin single
density”; CHR$(13); CHR$(10); CHR$(10); : D = 8:
GOTO 80
50
IF MODE = 2 THEN PRINT #1, “24 pin double
density”; CHR$(13); CHR$(10); CHR$(10); : D = 9:
GOTO 80
60
IF MODE = 3 THEN PRINT #1, “24 pin triple
density”; CHR$(13); CHR$(10); CHR$(10); : D = 11:
GOTO 80
70
IF MODE = 4 THEN PRINT #1, “24 pin sextuple
density”; CHR$(13); CHR$(10); CHR$(10); : D = 12:
80
PRINT #1, CHR$(27); “[g”; CHR$(96); CHR$(3);
CHR$(D);
90
REM CHR$(27); is the density defined in lines 32,
33, 34, 35 & 40