home *** CD-ROM | disk | FTP | other *** search
- 100 'The following program, written in HP150 GW-BASIC, provides the
- 110 'user with several menu choices for sending escape sequences to
- 120 'the THINKJET. One menu choice permits you to stay in BASIC and
- 130 'either modify the program or use GWBASIC's Direct Mode to send
- 140 'additional escape sequences not on the menu to the printer.
- 150 WIDTH 80
- 160 ESC$=CHR$(27)
- 170 PRNTR$="PRN" 'Select printer
- 180 REM
- 190 'The following writes the printer control menu to the screen
- 200 'and requests a user response
- 210 PRINT
- 220 PRINT
- 230 PRINT " "+DATE$+" "+TIME$
- 240 PRINT
- 250 PRINT " Thinkjet Printer Control Menu "
- 260 PRINT " ******************************* "
- 270 PRINT
- 280 PRINT " 1 = NORMAL Print, 80 cpl ";
- 290 PRINT " 2 = COMPRESSED Print, 142 cpl "
- 300 PRINT " 3 = EXPANDED Print, 40 cpl ";
- 310 PRINT " 4 = EXPANDED-COMPRESSED Print, 71 cpl "
- 320 PRINT " 5 = BOLD Print On ";
- 330 PRINT " 6 = Bold Print Off "
- 340 PRINT " 7 = PERFORATION Skip On ";
- 350 PRINT " 8 = Perforation Skip Off "
- 360 PRINT " 9 = UNDERLINE On ";
- 370 PRINT "10 = Underline Off "
- 380 PRINT "11 = 6 LPI [default] ";
- 390 PRINT "12 = 8 LPI (8 lines per inch) "
- 400 PRINT "13 = End of Line WRAP-AROUND ";
- 410 PRINT "14 = Without Wrap-Around "
- 420 PRINT
- 430 PRINT " S = Printer SELF-TEST ";
- 440 PRINT " R = RESET printer to DEFAULTS "
- 450 PRINT " B = BREAK (Stay in BASIC) ";
- 460 PRINT " M = redisplay MENU "
- 470 PRINT " E or Q = QUIT/Return to DOS or MENU"
- 480 PRINT
- 490 PRINT "Enter 1 thru 14, S, R, B, E, M, or Q => ";
- 500 INPUT " ",B$
- 510 'Menu Actions
- 520 IF B$="B" OR B$="b" THEN STOP 'Stop program execution, stay in BASIC
- 530 IF B$="Q" OR B$="q" THEN GOTO 830 'Quit, return to MENU or DOS
- 540 IF B$="E" OR B$="e" THEN GOTO 830 'Quit, return to MENU or DOS
- 550 IF B$="0" THEN GOTO 830 'Quit, return to MENU or DOS
- 560 IF B$="M" OR B$="m" THEN GOTO 210 'Redisplay Thinkjet Menu selections
- 570 OPEN "O",#1,PRNTR$ 'Directs output to printer selected above
- 580 IF B$="R" OR B$="r" THEN PRINT#1,ESC$+"E"; 'Reset printer to defaults
- 590 IF B$="S" OR B$="s" THEN PRINT#1,ESC$+"z"; 'Print Self-Test
- 600 IF B$="1" THEN PRINT#1,ESC$+"&k0S"; 'Set Normal Print
- 610 IF B$="2" THEN PRINT#1,ESC$+"&k2S"; 'Set Compressed Print
- 620 IF B$="3" THEN PRINT#1,ESC$+"&k1S"; 'Set Expanded Print
- 630 IF B$="4" THEN PRINT#1,ESC$+"&k3S"; 'Set Expanded-Compressed Print
- 640 IF B$="5" THEN PRINT#1,ESC$+"(s1B"; 'Set Bold Print on
- 650 IF B$="6" THEN PRINT#1,ESC$+"(s0B"; 'Set Bold Print off
- 660 IF B$="7" THEN PRINT#1,ESC$+"&l1L"; 'Set Perforation Skip on
- 670 IF B$="8" THEN PRINT#1,ESC$+"&l0L"; 'Set Perforation Skip off
- 680 IF B$="9" THEN PRINT#1,ESC$+"&dD"; 'Set Underline on
- 690 IF B$="10" THEN PRINT#1,ESC$+"&d@"; 'Set Underline off
- 700 IF B$="11" THEN PRINT#1,ESC$+"&l6D"; 'Set 6 lpi
- 710 IF B$="12" THEN PRINT#1,ESC$+"&l8D"; 'Set 8 lpi
- 720 IF B$="13" THEN PRINT#1,ESC$+"&s0C"; 'Set Wrap-Around on
- 730 IF B$="14" THEN PRINT#1,ESC$+"&s1C"; 'Set Wrap-Around off
- 740 CLOSE #1
- 750 IF B$="1" OR B$="2" OR B$="3" OR B$="4" THEN GOTO 810 'Close Printer
- 760 IF B$="5" OR B$="6" OR B$="7" OR B$="8" THEN GOTO 810 'Close Printer
- 770 IF B$="9" OR B$="10" OR B$="11" OR B$="12" THEN GOTO 810
- 780 IF B$="13" OR B$="14" OR B$="S" OR B$="s" THEN GOTO 810
- 790 IF B$="R" OR B$="r" THEN GOTO 810
- 800 GOTO 210 'Re-display Menu
- 810 PRINT "ok"
- 820 GOTO 490
- 830 SYSTEM