Ask Chuck

Author(s): Chuck Dawson
Publication: The Data Expansion
Pub Details: The D/FW Data Expansion v4 n11 (Volume 4, Issue 11)
Date: November 1987
Pages: 6-8

Dear Reader:

For the past several years, this space has been titled “Timex Tips”. With Amstrad’s buying of Sinclair, and the dominance of MS-DOS in the marketplace, a new title seems in order. I will continue to answer any Timex or Sinclair questions when they are received, but I will also attempt to answer questions from the broader areas of MS-DOS.

This week, I received in the mail a newsletter dedicated to the Zebra disk drive system. In it, they printed the disk catalogue program which appeared in this space over a year ago (there also was a couple of modified version which I liked very much). In that same newsletter was a challange for anyone to come up with a program that will read the catalogue of the disk, but allow the scroll to be stopped for inspection if the list is longer than a single screenful. I have come up with something that will do that. If someone else has a better solution, please send it to me and I’ll print it here to be shared by all.

   1 REM  CLEAR : SAVE *"START"
LINE 1: REM by Chuck Dawson
2 REM ----------------------+
+ COMMANDS +
+ +
+"5","6","7","8" MOVE HIGHLIGHT+
+":" CHANGES TO THE ROOT DIR +
+"^" CHANGES TO THE PARENT DIR +
+"." CATALOGS THE DISK AGAIN +
+"?" SHOWS FULL INFORMATION +
+"ENTER" -LOAD PROGRAM OR CODE +
+"ENTER" DIR-CHANGE TO THAT DIR+
+------------------------------+
10 CLEAR : DIM a$(44,32)
20 FOR i=1 TO 43
30 READ a: POKE 23295+i,a
40 NEXT i: PRINT AT 0,0; FLASH 1;" DISK ACCESS "
50 LET a=PEEK 26703: LET b=PEEK 26704
60 POKE 23748,79: POKE 23749,183
70 OPEN #2,"P"
80 POKE 26703,0: POKE 26704,91
90 CAT *
100 CLOSE #2: POKE 26703,a: POKE 26704,b: POKE 23692,1
110 LET end=PEEK 23748+256*PEEK 23749-29
120 LET vars=PEEK 23627+256*PEEK 23628
130 LET b$="": FOR i=end+21 TO end+28: LET b$=b$+CHR$ PEEK i:
NEXT i
140 CLS : FOR i=46928 TO end
150 LET z=i: IF PEEK (i-1)=13 AND PEEK (i-2)=45 THEN LET
p=vars+8: GO TO 200
160 IF PEEK 23689>21 THEN PRINT CHR$ PEEK i;
170 NEXT i: PRINT AT 1,0;"No Files in Directory": PAUSE 0: RUN
200 POKE 65530,INT (p/256): POKE 65529,p-256*INT (p/256)
210 POKE 65532,INT (i/256): POKE 65531,i-256*INT (i/256)
220 LET bc=end-i: POKE 65534,INT (bc/256): POKE 65533,
bc-256*INT (bc/256)
230 RANDOMIZE USR 23325
240 PRINT AT 1,18;b$
300 FOR j=1 TO 44: IF a$(j,1)=" " THEN GO TO 308
305 NEXT j
308 LET top=3: LET col=0
309 IF INT (j/2)>19 THEN LET top=22-INT (j/2)
310 PRINT AT 1,15;" " AND top<2: LET lin=top: FOR i=1 TO j-1
320 PRINT AT lin,col;a$(i,1 TO 12);a$(i,29 TO 30)
330 LET lin=lin+1
340 IF i=INT (j/2) THEN LET col=17: LET lin=top
350 NEXT i
400 LET cursor=3: LET seg=0
410 LET v$=" ": REM 14 GRAPHIC SHIFT 8s
420 PRINT AT cursor,seg; OVER 1;v$
430 IF INKEY$="6" AND SCREEN$ (cursor+1,seg)<>" " THEN PRINT AT
cursor,seg; OVER 1;v$: LET cursor=cursor+1-(cursor=21): GO TO
420
440 IF INKEY$="7" AND SCREEN$ (cursor-1,seg)<>" " THEN PRINT AT
cursor,seg; OVER 1;v$: LET cursor=cursor-1+(cursor=0): GO TO
420
450 IF INKEY$="8" AND seg=0 AND SCREEN$ (cursor,17)<>" " THEN
PRINT AT cursor,seg; OVER 1;v$: LET seg=17: GO TO 420
460 IF INKEY$="5" AND seg=17 THEN PRINT AT cursor,seg; OVER
1;v$: LET seg=0: GO TO 420
470 IF INKEY$="." THEN GO TO 1
475 IF INKEY$="^" THEN GO TO *"^": GO TO 1
480 IF INKEY$=":" THEN GO TO *":": GO TO 1
485 IF INKEY$=CHR$ 13 THEN GO TO 500
490 IF INKEY$="?" THEN CLS : PRINT AT 8,0;: FOR i=z-63 TO z-1:
PRINT CHR$ PEEK i;: NEXT i: PRINT a$((seg=17)*INT (j/2)
+1+cursor-top): PAUSE 0: GO TO 130
495 GO TO 430
500 LET l$="": FOR i=0 TO 11
510 LET l$=l$+SCREEN$ (cursor,seg+i)
520 NEXT i
530 IF l$(10)<>" " THEN LET l$(9)="."
540 IF l$(10 TO 12)="DIR" THEN GO TO *l$: GO TO 1
550 OPEN #*1;l$;i;1: INPUT *#1;n$: LET l=CODE n$
560 INPUT *#1;n$: LET m=CODE n$: INPUT *#1;n$: LET m=m+256*CODE
n$: CLOSE #*1
570 CLS : GO TO 600+l*10
600 LOAD *l$
610 PRINT AT 10,0;"Numeric Array-Not Loadable": PAUSE 30: GO TO
130
620 PRINT AT 10,0;"Character Array-Not Loadable": PAUSE 30: GO
TO 130
630 IF m=6912 THEN LOAD *l$SCREEN$ : PAUSE 0: GO TO 130
640 LOAD *l$CODE : GO TO 130
3650 PRINT AT 10,0;"Non Loadable Seq or Random File": PAUSE 100:
GO TO 130
5000 DATA 245,197,213,229,17,0,0,79,205,9,32,56,2,207,20,121,
42,196,92,119,35,34,196,92,225,209,193,241,201,237,91,249,255,
42,251,255,237,75,253,255,237,176,201

I used storage space starting at location 46927, which is the same location used in Jack Dohany’s modified versions of MSCRIPT. This means that after the CAT program has been run, you can load MS5Z, do a RESTORE, and go to Mscript to find the catalogue as a document. It can be modified, printed, and saved normally.

I would like to take this opportunity to thank everyone who has taken the time to write to me (C/O The DFW Data Expansion) either with questions or comments. Your interest is the life blood of this column.

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