home *** CD-ROM | disk | FTP | other *** search
- 10 ' Program to output graphics test to the NEC 8023A-C Printer.
- 20 ' By Robert L. Hill, 7/12/82, 59 Gold St.,Rochester,N.Y. 14620
- 25 ' CompuServe 71455,1634
- 30 WIDTH "lpt1:",255 '-Sets length of line to 255--Supresses CR LF at end.
- 40 OPEN "lpt1:" AS #1 '-Opens printer for output in random mode. This does
- 50 ' not work in ver. 1.00 of BASIC where you would get
- 60 ' an error for line 40. By leaving line 40 out and
- 70 ' using LPRINT B$ in line 190 to output the string,
- 80 ' everything almost works except that BASIC adds a
- 90 ' CHR$(10) (line feed) after every CHR$(13) (carriage
- 100 ' return) in the string. Ver. 1.05 fixes this problem
- 110 ' by allowing output to the printer in random mode
- 115 ' with a width of 255, so all characters are sent to
- 120 ' the printer without change.
- 125 CLS
- 130 PRINT"This program tests the graphic print on the NEC 8023A printer."
- 140 LPRINT "graphic print"
- 150 LPRINT
- 160 LPRINT CHR$(&H1B);CHR$(&H54)"16"; 'Sets line spacing to 16/144 inch (8 dots)
- 170 '
- 180 '----This section just sets up a string to send to the printer.------
- 190 B$=CHR$(1) '-Initialize string with 00000001 as first code.
- 200 FOR X%=2 TO 255 '-This loop extends the string with each consecutive
- 210 A$=CHR$(X%) ' binary code from 00000010 to 11111111. This tests
- 220 B$=B$+A$ ' all the bit patterns for the printer and gives a
- 230 NEXT X% ' nice design when repeated as done below.
- 235 '-------------------------------------------------------------------------
- 240 '----This section prints the bit pattern in the string 10 times.-------
- 250 FOR L=1 TO 10
- 260 LPRINT CHR$(&H1B);CHR$(&H53);"0255"; 'select graphic mode (255 bytes)
- 270 PRINT#1,B$ 'Output the string to the printer.
- 280 LPRINT 'Send a carrage return (CR=CHR$(13)) + line fed (LF=CHR$(10)).
- 290 NEXT L '-----------------------------------------------------------------
- 300 'To get more condensed graphics add LPRINT CHR$(&H1B);CHR$(&H51); to front of program.
- 310 LPRINT CHR$(&H1B);"A"; 'Restore line spacing to normal.
- 320 END
- RINT CHR$(&H1B);CHR$(&H51); to front of program.
- 310 LPRINT CHR$(&H1B);"A";