Switching Printer Characters

Author(s): Robert Hartung
Publication: Update Magazine
Pub Details: Update January 1991
Date: January 1991
Pages: 30-32

About the time Epson began bringing out third and fourth generations of its 24-pin printers I finally scratched together enough shekels to go for their LQ-510. My decision to go with Epson vs Star, Panasonic, Citizen, Okidata, Alps et al was largely because of a marked cut in price and the inclusion of a 7-font module to sweeten up the deal by a discount supplier. I also was looking at true compatibility with SW that is set up for Epson code, and ribbon cartridges that cost less than half as much as those used by other printers.

The screen dump in QL Easel and the pre-set FX-80 codes in INSTALL_BAS work as is, although of course these and the TRANSLATE sequences may be modified to almost any printer command. One translation I made was to provide a cross-slash zero character, which is not in the normal U.S. font mode. To do this I used character 92 in the Denmark table by installing the sequence “0,ESC,”R,4,92,ESC,”R,0 as per the example given in the QLUG INFO section on page 6. A copy of this version of INSTALL_BAS printer data may be stored on another disk to have the option of doing printouts from the PSION SW with either the plain zero character (0) or with the cross-slash (Ø) as in this mss. just by switching disks before calling for a printout. If you have RAMdisk capabilities, by storing two or more customized printer_dat and install_dat copies on your QUILL disk, each with a distinguishing title as in listing 1 to boot QUILL, the selected one may be accessed from RAMdisk instead of from disk (or mdv). ( CONFIG_BAS is used to set the system device to RAMn.)

However, for my own SW programs such as QL_LLIST on my UPDATE Issue Disk, I had to work out a way of scanning listing and text files for each zero, then translating it to the Danish character, and returning to the U.S. font table. Almost all alphanumeric characters will print correctly if the printer is left in the Denmark (or Norway) font table, except that the reverse-slash recognized by the QL as LF code would then print out as Ø everytime it occurred.

Listing 2 was used to do this printout of itself. It may also be used for printing any ASCII text file formed by my INFOwriter program or by any other text editor that does not insert formatting codes such as those used by the Psion SW. The routines used to set left margins, column width, and number of lines in each print-sequence will work with any printer. Change the character-switch code in zr$ (line 130) to that required by your printer.

Listing 3 is for reading Tasword 2068 files and translating marked characters to extended-font characters when printed out (which the Tasword printer-driver will not read). As listed, it shows commands and DATA characters/codes for my C. Itoh 8510, but may be adapted to any printer. The £ sign and @ are used to mark off any character(s) to be translated. EG: £ab@ would print as alpha and beta.

Either the Oliger printer-driver may be used or a SW driver such as the one in Tom Woods‘ ProFile may be stored in a first-line REM statement. Insert REM in either line 10 or line 20 to disable the one not being used. Page nos. and headers may be printed after each selected number of lines or whenever 0 is keyed.

BOOT ROUTINE FOR QUILL

10 CLEAR: FLP_USE mdv
20 INPUT "Cross-slash zero Ø y/n? ";yn$"Key ENTER to skip printer set ";a$: IF a$="" THEN GO TO 100
30 INPUT 'PICA=P ELITE=M COND=g DRAFT=0 or LQ=1? ';F$
40 INPUT 'LF: 1/8"=0 or 1/6"=2?';L$
50 INPUT 'LM cols n? ';C: C$='l' & CHR$(C)
60 INPUT 'BOLD=E or cancel BOLD=F? ';B$'PROP 1=ON 0=OFF? ';prp: prop$='p' & CHR$(prp)
70 OPEN #7,ser1
80 PRINT #7,CHR$(27);F$;CHR$(27);L$;CHR$(27);C$;CHR$(27);B$;CHR$(27);prop$
90 CLOSE #7
100 IF yn$=="y" THEN COPY mdv1_printerZ_dat TO ram1_printer_dat: COPY mdv1_installZ_dat TO ram1_install_dat: ELSE COPY mdv1_printer_dat TO ram1_printer_dat: COPY mdv1_install_dat TO ram1_install_dat
110 WINDOW 512,256,0,0:CSIZE 2,1:CLS
120 AT 2,11:PRINT "LOADING QL-WP"
130 AT 4,13:PRINT "version ";2.1
140 AT 6,6:PRINT "copyright 1984 PSION LTD"
150 AT 8,12:PRINT "word processor"
160 CLOSE #1:CLOSE #2:WINDOW #0,400,20,35,215
170 EXEC_W MDV1_QLWP
180 OPEN #1,scr:OPEN #2,scr

LPRINT0_O

10 PRINT 'Enter YOUR printer codes in line 20'' or omit 10-20 if  not needed': PAUSE 100
20 CLS: INPUT 'CPI: P=10 M=12 panelset Conds/Draft ';cpi$: OPEN #7,ser1: PRINT #7,CHR$(27);cpi$: CLOSE #7
25 INPUT 'Use cross-slash Ø y/n? ';cz$
30 CLS: CLS #0: INPUT #0;'Q to quit''Print listing or text in drive #';drv$: md$='mdv' & drv$ & '_': IF drv$='q' OR drv$='Q' THEN STOP: END IF : PRINT 'Change line 30''from mdv to flp for disc'
40 PRINT 'Key F5 TO SCROLL TK2 DIRECTORY': PAUSE 100: DIR md$
50 INPUT #0; 'File Name? ';y$: md$=md$ & y$
60 CLS #0: curln=0: remln=0: REMark current line; remaining line
70 OPEN_IN #8,md$
80 OPEN #7,ser1
90 CLS: INPUT 'Enter zero to cancel ';(y$)'No. lines this page-column: ';lines: IF lines=0 THEN CLOSE #7: CLOSE #8: GO TO 30: END IF
100 INPUT "Columns per line: ";col
110 INPUT 'Left-margin setting: ';lm: lm=lm-1: lm$='': lm$=lm$ & FILL$(' ',lm)
120 INPUT 'Key ENTER to skip title-print any chr to print ';t$: IF t$ <>'' THEN tl$='': tl$=tl$ & FILL$(' ',INT(col/2+lm)-INT(LEN(y$)/2)): PRINT #7,tl$;y$: PRINT #7: END IF
130 LET zr$=CHR$(27) & 'R' & CHR$(4) & CHR$(92) & CHR$(27) & 'R' & CHR$(0)
140 cnt=0: IF t$<>''THEN cnt=2: END IF : REMark count print-lines
150 IF remln<>0 THEN cnt=cnt+curln-remln: GO TO 300
160 nf=1000
170 IF EOF(#8) THEN CLOSE #7: CLOSE #8: GO TO 30: END IF
180 IF cnt>=lines THEN GO TO 90: END IF
190 INPUT #8,p$: IF LEN(p$)=0 THEN p$=' '
200 lp=LEN(p$)
210 IF p$(lp)=' ' THEN lp=lp-1: END IF
220 IF cz$=='y' AND lp<=col THEN cnt=cnt+1: PRINT #7,lm$;: FOR x=1 TO LEN(p$): IF p$(x)='0' THEN PRINT #7,zr$;: NEXT x: PRINT #7: ELSE PRINT #7,p$(x);: END FOR x: PRINT #7:END IF : END IF
225 IF cz$=='n' AND lp<=col THEN cnt=cnt+1: PRINT #7,lm$;p$(1 TO lp)
230 IF lp<=col THEN GO TO 170
240 curln=INT(lp/col)
250 DIM lin$(curln,col)
260 FOR n=0 TO curln
270 LET clp=col*n+1: IF clp>lp THEN LET clp=lp
280 lin$(n,1 TO col)=p$(clp TO lp)
290 END FOR n
300 FOR k=remln TO curln
310 IF cz$=='y' THEN PRINT #7,lm$;: FOR x=1 TO col: IF lin$(k,x)='0' THEN PRINT #7,zr$;: NEXT x: PRINT #7: ELSE PRINT #7,lin$(k,x);: END FOR x: PRINT #7: END IF : END IF
315 IF cz$=='n' THEN PRINT #7,lm$;lin$(k, 1 TO col)
320 cnt=cnt+1: IF cnt>=lines THEN remln=k+1: IF remln>curln THEN remln=0: END IF : GO TO 90: END IF
330 END FOR k
340 remln=0
350 GO TO 170
360 DEFine PROCedure sv: SAVE mdv1_LPRINT0_O: END DEFine

TEXT PRINTER

   1 REM   Pad this line out to 117 characters & put P/F driver here with LOAD "prtcode"CODE PEEK 23635+PEEK 23636*256+5
5 REM Printer commands for C. Itoh 8510
10 REM POKE 26703,PEEK 23635+5: POKE 26704,PEEK 23636: REM Use only with line 1 REM driver
20 LET /p=o: POKE 23300,60: POKE 23301,3: POKE 23323,65: REM Use only with Oliger driver
25 ON ERR RESET
30 CLEAR 33279
35 INPUT "Key any CHR$ to repeat printout"'"or key ENTER for new file,"'"then key BREAK to enter title";a$: IF a$<>"" THEN GO TO 60
40 ON ERR GO TO 45: CAT
45 ON ERR RESET : INPUT "TASWORD file title to load:"'f$
50 LOAD /f$CODE 33280
60 ON ERR GO TO 180: CLS : LET c$="0000": LET I=PI/PI: INPUT "Left Margin=nnn? ";e$''"Pica-N Elite-E Prop-P? ";f$''"Page header--N/L none",a$''"Dbl.sp? y/NL ";c$(I)''" LINE FOR auto-page OR 0? ";c$(I+I TO ): LET j0=VAL c$(I+I TO )
70 LPRINT CHR$ 27;f$;CHR$ 27;"&";CHR$ 27;"!";CHR$ 27;"L";e$;
80 LET b=I: LET c=j0: LET d$="(I+INT (N-33280)/64)"
90 FOR N=33280 TO 52480 STEP 64
100 INPUT "": PRINT #NOT PI;AT I+I,NOT PI;" LINE ";VAL d$;" 0 FOR PG OR LINE ";VAL c$(I+I TO )+c*(j0=NOT PI)," BREAK LPRINT TO STOP "
110 FOR J=N TO N+VAL "63"
120 IF PEEK J=CODE "£" THEN GO SUB 190: GO TO 140
130 PRINT CHR$ PEEK J;: LPRINT CHR$ PEEK J;
140 NEXT J
150 LPRINT
160 IF INKEY$="0" OR VAL d$=VAL c$(I+I TO ) THEN GO TO 290
170 NEXT N
180 PRINT FLASH I'" STOP LPRINT ": PAUSE 100: LPRINT : GO TO 25
190 FOR f=J+1 TO J+63
200 IF PEEK f=CODE "@" THEN LET J=f: RETURN
210 RESTORE 320
220 FOR g=1 TO 30
230 READ e$: READ f$
240 IF PEEK f=CODE e$ THEN PRINT e$;: LPRINT CHR$ VAL f$;
250 NEXT g
260 IF PEEK f=CODE "c" THEN LPRINT "c";
270 NEXT f
280 LET J=f: RETURN
290 LET c$(I+I TO )=STR$ (j0+VAL d$): LET b=b+I: INPUT "Insert PAGE ";(b);b$: LPRINT CHR$ 27;"X Page ";b;" -- ";a$;CHR$ 27;"Y": LPRINT : IF c$(I)="0" THEN LPRINT
300 IF c=0 THEN LET c=VAL d$
310 GO TO 170
320 DATA "a","160","b","161","z","162","d","163","e","164","f","165","g","166","h","167","i","168","j","169","k","170","l","171","m","172","n","173","o","174","p","175","q","176","r","177","s","178","t","179","u","180","v","181","w","182","x","183"
330 DATA "G","185","D","184","L","187","S","186","X","240","Z","188"
9999 SAVE /"tasprt" LINE 10
Sample printout of the extended-font Greek characters (EG: alpha to Chi)
Sample printout of the extended-font Greek characters (EG: alpha to Chi)

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