home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / BASIC00.ZIP / NEC8023A.BAS < prev    next >
Encoding:
BASIC Source File  |  1987-01-11  |  2.4 KB  |  38 lines

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