Menu-Driven Printer_DAT Selection

See all articles from Update April 1993

Some may have noted that a large part of the things I have written for UPDATE have been to enable single-key selection of programs or other functions from menus. From the first time I set hands on a computer (a ZX-80) I have had the notion that the user shouldn’t have to do what the computer may easily be programmed to do. Not all programs I have seem to have been written with this in mind.

A case in point is the need to run the INSTALL_BAS program every time a new set of printer data is needed for the PSION suite of four or EXCHANGE. I have tried several other wordprocessors and spreadsheet programs for the QL as well as the PC and still prefer to use QUILL and ABACUS for most purposes. I would add my voice to those asking if someone might do an update on these programs while still retaining their best features.

The routine listed below allows the selection of any pre-defined printer data before loading one of the PSION programs. It is the result of my friend, Kenton Garrett, asking me to write a routine that would select different sets of printer data for each of the printers he uses with his QL system. It is written so it may be merged with my BOOTmenu program as given on page 22 of the Oct. 92 UPDATE. If you do not have that issue please enclose a SASE when you request me to send you a copy of the listing.

If you already have defined printer_dat on separate disks you may simply put the disk with the completed BOOT routine in flp2, the printer_dat disk in flp1, and enter COPY flp1_printer_dat TO flp2_newname_dat. “Newname” is the title as entered in respective pdat definitions. Note that the _dat extension is supplied by the menu routine and so is included in the disk file names but not in the menu titles.

To create new printer_dat files, LRUN INSTALL_BAS from flp1 and install to flp2, the drive your BOOT disk is in. After installing with F5, key CTRL SPACE to break into the program. Use COPY flp2_printer_dat TO flp2_newname_dat. Enter RUN to re-start INSTALL_BAS and repeat the above for each set of data. To use with EXCHANGE see the line 725 REMark.

75 PRINT " PROGRAM MENU (BREAK & AUTO 1
,1 to edit)"
80 PRINT #0;" Key: A-Z for other menus
0-9 or a-z to LOAD file F1 to select
new printer_dat £ to set: ",,,," B:
Last menu"
85 REMark Omit line 165 & save copy of l
ines 1-250 as Bboot. Revise line 80 pro
mpt for Cboot . . . .
165 IF slc=232 THEN pdat
260 DEFine PROCedure pdat
270 MODE 4: DIM d$(36,18): d$(1)="LASTus
ed"
280 d$(2)="CITOH"
290 d$(3)="KXPallfonts"
300 d$(4)="KXPprestige"
310 d$(5)="KXPcourier"
320 d$(6)="KXPsanserif"
330 d$(7)="KXPboldPS"
340 d$(8)="QLprinter"
350 d$(9)="EPSON510"
360 d$(10)="": REMark Define empty d$(1
1) through d$(36) in lines 370-620 as in
line 360
630 FOR j=1 TO 36
640 AT j-1-18*(j>18),20*(j>18): PRINT CH
R$ (j+47+39*(j>10));"=";d$(j)
650 END FOR j
660 PRINT " PRINTER_DAT MENU"
670 CLS #0: PRINT #0;" KEY: 0-9 or a-z
to select printer_dat to be activated (i
n both flp1_ and ram1_)"" Use AUTO 270,
10 to edit menu display titles. Do NOT
append _dat to menu titles."' "Not Foun
d" error if _dat used in menu titles or
if misspelled. Key ESC to quit.'
680 slc=CODE(INKEY$): IF slc=0 THEN GO T
O 680
690 IF slc=27 THEN MODE 4: GO TO 50
700 slc=slc-47-39*(slc>57)
710 IF slc < 0 OR slc > 36 THEN GO TO 63
0
720 IF d$(slc)="" THEN GO TO 630
725 REMark For EXCHANGE, replace printer
_dat in line 730 with xchange_dat or re-
define as line 735 for both options
730 DELETE flp1_printer_dat: COPY "flp1_
" & d$(slc) & "_dat" TO flp1_printer_dat
: DELETE ram1_printer_dat: COPY "flp1_"
& d$(slc) & "_dat" TO ram1_printer_dat
740 DELETE flp1_LASTused_dat: COPY flp1
_printer_dat TO flp1_LASTused_dat
750 MODE 4: GO TO 50
760 END DEFine pdat

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.