Shows the directory of any device in four columns of sixteen names, so that a long directory no longer scrolls off the screen; press a key for the next screenful. The directory is written to a file called directory on the device first, so it needs a little free space. Type PRINTIT afterwards to print the directory four across on an 80-column printer on SER1.
It is laid out for a MONITOR or WTV mode 4 window of 450×190 at 25,15; the article explains which numbers to change for other window sizes, column spacing or a printer on SER2. As printed, lines 290 and 520 end their IF blocks with ENDIF instead of END IF, and line 440 takes the length of line$(x) instead of line$(i).
Published in Sinc-Link September-October 1989 (A Full Window Directory for the Sinclair QL).
Source Code
10 REMark ** A full window directory **
20 REMark ****** by Mike Ferris *******
30 REMark *****************************
100 CLS
110 INPUT 'Enter device:'!a$
120 OPEN_OVER #4,a$&'directory'
130 DIR #4,a$
140 CLOSE #4
150 CLS
160 AT 0,2:PRINT a$
170 OPEN_IN #4,a$&'directory'
180 DIM line$(128,15)
190 x=0:a=2:b=2
200 REPeat getline
210 IF EOF(#4) THEN EXIT getline
220 INPUT #4,line$(x)
230 AT a,b:PRINT line$(x)
240 IF a=16 and b=56
250 PRINT #0,'PRESS ANY KEY FOR MORE...'
260 z$=INKEY$(-1)
270 CLS
280 a=2:b=2
290 ENDIF
300 a=a+1:x=x+1
310 IF a>16 THEN b=b+18:a=3
320 END REPeat getline
330 CLOSE #4
340 STOP
350 DEFine PROCedure printit
360 OPEN #3,ser1
370 t=1
380 FOR i=0 to 1
390 PRINT #3,line$(i)
400 NEXT i
410 PRINT #3
420 text$=''
430 FOR i=2 to x
440 length=LEN(line$(x))
450 fil=20-length
460 text$=text$&line$(i)
470 IF (t MOD 4)=0
480 PRINT #3,text$
490 text$=''
500 ELSE
510 FOR k=1 to fil:text$=text$&' ':NEXT k
520 ENDIF
530 t=t+1
540 NEXT i
550 PRINT #3,text$
560 CLOSE #3
570 END DEFineNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.