CAT Prints on Your QL

See all articles from Update April 1989

No, this isn’t about feline graffiti on the hood of your QL, but is a way of making hard copies of the file directories on your microdrives. It is an adaptation of a screen-print only utility provided by Mike Lloyd in the May 1987 QL World. It also demonstrates the use of a defined string for device parameters to avoid syntax errors that otherwise occur. I don’t have a QL DOS but I think with appropriate changes in SAVE/LOAD syntax it should work with one and also RAMdisk. Note that the MDV or disk being cataloged cannot be write-protected as the temporary cat_dat file is stored on it, then deleted.

CATPRINT

10 MODE 8
20 INPUT 'Left margin: ';lm: lm$='': lm$=lm$ & FILL$(' ',lm)
30 OPEN #7,ser1
40 PRINT #7,CHR$(27) & 'E';CHR$(27) & 'B';CHR$(27) & '!':CLOSE #7
50 INPUT 'Drive no. ';drive
60 CLS
70 OPEN #7,ser1
80 d$='mdv' & drive & '_'
90 OPEN_NEW #3,d$ & 'cat_dat'
100 DIR #3,d$: CLOSE #3: CLS
110 OPEN_IN #3,d$ & 'cat_dat'
120 INPUT #3,line$: PRINT 'CATALOG: ';line$: PRINT #7,lm$;'CATALOG: ';line$
130 REPeat loop
140 FOR x = 1 TO 18
150 INPUT #3,line$
160 IF line$ <> 'cat_dat_'THEN PRINT line$: PRINT #7,lm$;line$
170 IF EOF(#3) OR KEYROW(1)=8: EXIT loop
180 END FOR x
190 PRINT 'More >': PAUSE
200 AT 2,0: CLS 3: CLS 2
210 END REPeat loop
220 PRINT #7
230 CLOSE #3: CLOSE #7: DELETE d$ & 'cat_dat'
240 GO TO 50
250 DEFine PROCedure sv: SAVE mdv1_catprint: END DEFine

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