160 TEXT : HOME : PRINT "EXPANDED PRODOS CATALOG": PRINT "Copyright 1986 by MicroSPARC, Inc."
170 VTAB 4: PRINT "This program will reveal all of the files that are on a ProDOS-formatted disk. It will show all of the files including even those that have been saved under various subdirectories."
180 PRINT
190 PRINT "Please indicate how the disk is to be located:"
200 VTAB 10: CALL -958
210 HTAB 7: PRINT "1) Disk Drive 1"
220 PRINT
230 HTAB 7: PRINT "2) Disk Drive 2"
240 PRINT
250 HTAB 7: PRINT "3) By Volume or Partial Pathname"
260 PRINT
270 HTAB 7: PRINT "4) Exit This Program"
280 VTAB 18
290 PRINT "Please enter a number (1, 2, 3, or 4) -> ";: GET DN$: IF DN$ > CHR$(48) THEN PRINT DN$
300 IF DN$ < >"1" AND DN$ < >"2" AND DN$ < >"3" AND DN$ < >"4" THEN GOTO 200
310 IF DN$ = "4" THEN TEXT : HOME : END
320 IF DN$ = "3" THEN GOTO 350
330 IF DN$ = "" OR DN$ = "1" THEN PRINT CHR$(4);"PREFIX,D1": PRINT CHR$(4);"PREFIX": INPUT "";DN$: LET CPFX$ = DN$: LET DN$ = LEFT$(DN$,( LEN(DN$) -1)): GOTO 380
340 IF DN$ = "2" THEN PRINT CHR$(4);"PREFIX,D2": PRINT D$"PREFIX": INPUT "";DN$: LET CPFX$ = DN$: LET DN$ = LEFT$(DN$,( LEN(DN$) -1)): GOTO 380
350 VTAB 8: CALL -958: VTAB 12
360 INPUT "Please enter the volume or partial pathname -> ";DN$
370 IF LEFT$(DN$,1) < >"/" THEN DN$ = "/" +DN$
380 VTAB 8: CALL -958
390 PRINT "Do you want this listing on the printer? (Y/N) -> ";: GET PF$: PRINT PF$
400 IF PF$ = "Y" OR PF$ = "y" THEN GOSUB 910: GOTO 450
410 IF PF$ = "N" OR PF$ = "n" THEN GOTO 440
420 IF PF$ = CHR$(13) THEN PF$ = "N": GOTO 440
430 GOTO 380
440 HOME
450 LET L = 1:NL = 1
460 LET PPN$ = DN$: REM --PARTIAL PATHNAME
470 GOSUB 630
480 LET DF(NL) = S: REM --NUMBER OF DIRECTORIES FOUND IN THIS LEVEL
490 LET NL = NL +1
500 LET SS = S: LET S = 0
510 FOR Z = 1 TO SS
520 IF DIR$(NL -1,Z) = "" THEN GOTO 580
530 IF NL > = 3 THEN LET PPN$ = PPN$(NL -1,Z) +"/" +DIR$(NL -1,Z): GOTO 550
540 LET PPN$ = DN$ +"/" +DIR$(NL -1,Z): REM --PARTIAL PATHNAME
550 GOSUB 630
560 NEXT
570 GOTO 480
580 IF PF$ = "N" OR PF$ = "n" THEN GOTO 620
590 PRINT CHR$(12): REM --FORM FEED
600 PRINT D$;"PR#0"
610 VTAB 12: CALL -868: LET A$ = " Press <RETURN> to return to the menu ": HTAB 20 - LEN(A$)/2: PRINT A$;: GET R$: PRINT R$: RUN
620 PRINT : PRINT : VTAB 22: LET A$ = " Press <RETURN> to return to the menu": INVERSE : POKE -16368,0: GOSUB 1810: NORMAL : RUN
630 REM --READ THE DIRECTORIES
640 PRINT D$;"OPEN ";PPN$;",TDIR"
650 PRINT D$;"READ ";PPN$
660 PRINT
670 PRINT PPN$
680 PRINT
690 LET M = 1
700 INPUT L1$: REM --READ NAME
710 INPUT L2$: PRINT L2$: REM --READ TITLE
720 INPUT L3$: PRINT L3$: REM --READ BLANK LINE
730 INPUT L4$: PRINT L4$: REM --READ FILES
740 IF MID$ (L4$,18,3) = "DIR" THEN LET S = S +1: LET DIR$(NL,S) = MID$ (L4$,2,15): LET PPN$(NL,S) = PPN$: GOSUB 860
750 LET TB = VAL( MID$ (L4$,24,5))
760 LET BT = BT +TB
770 IF L4$ < >"" THEN LET M = M +1: GOTO 730
780 INPUT L5$
790 LET BL = BL +BT
800 LET BR = VAL( MID$ (L5$,15,3))
810 PRINT M -1;" Files Listed, ";BT;" Blocks This List, ";BL;" Total Blocks Listed, ";BR;" Blocks Free"
820 LET BT = 0
830 PRINT D$;"CLOSE ";PPN$
840 PRINT
850 RETURN
860 REM --REMOVE SPACES AT END OF DIRECTORY NAME
870 FOR Q = 1 TO 15
880 IF MID$ (DIR$(NL,S),Q,1) = " " THEN LET DIR$(NL,S) = MID$ (DIR$(NL,S),1,Q -1): LET Q = 15: GOTO 890
890 NEXT
900 RETURN
910 REM --PRINTER ROUTINE
920 HOME
930 PRINT CHR$(21)
940 VTAB 12
950 HTAB 16
960 FLASH : PRINT " PRINTING ": NORMAL
970 PRINT D$;"PR#1"
980 PRINT CHR$(9);"80N"
990 PRINT CHR$(9);"60P"
1000 RETURN
1010 REM --ERROR HANDLER
1020 LET EN = PEEK(222): PRINT D$"PR#3"
1030 IF EN = 6 OR EN = 7 THEN GOSUB 1120: GOTO 1120
1040 IF EN = 8 THEN GOSUB 1190: GOTO 1120
1050 IF EN = 3 THEN GOSUB 1190: GOTO 1120
1060 IF EN = 12 THEN PRINT CHR$(4);"CLOSE": GOTO 1120
1070 IF EN = 13 THEN GOSUB 1910: GOTO 1120
1080 IF EN = 16 THEN GOSUB 1540: GOTO 1120
1090 IF EN = 20 THEN GOSUB 1380: GOTO 1120
1100 PRINT "Error # ";EN;" occurred in line "; PEEK(218) + PEEK(219) *256: GOSUB 1780: GOTO 1120
1120 GOTO 140
1130 ONERR GOTO 1720
1140 PRINT D$;"PREFIX": INPUT CPFX$
1150 HOME : VTAB 4: PRINT "Sorry, but I cannot find the path that you indicated. Please check the": PRINT "following and try again:"
1160 VTAB 8: PRINT "1) Check your spelling of the pathname - you spelled it": PRINT PPN$: VTAB 12: PRINT "2) Check that the partial pathname you chose works with the current prefix": PRINT " which is ";CPFX$
1170 GOSUB 1770
1180 RETURN
1190 REM --ERROR I/O ERROR
1200 HOME
1210 VTAB 4
1220 PRINT "I am having difficulty with reading the disk in Drive ";DN$
1230 PRINT
1240 PRINT "Please check each of the following until the problem is corrected:"
1250 VTAB 8
1260 HTAB 7: PRINT "1) The door in Drive ";DN$;" is open - close it!"
1270 PRINT
1280 HTAB 7: PRINT "2) There is no disk in Drive ";DN$;" - put one in."
1290 PRINT
1300 HTAB 7: PRINT "3) The disk is not formatted or is in a format other than ProDOS.": PRINT " This program only works with properly formatted ProDOS disks."
1310 PRINT
1320 HTAB 7: PRINT "4) Try reseating the disk by taking it out and then putting it": PRINT " back into the drive."
1330 IF DN$ = "1" THEN GOTO 1360
1340 PRINT
1350 HTAB 7: PRINT "5) Is there a Drive ";DN$;" in your system?"
1360 GOSUB 1770
1370 RETURN
1380 REM --ERROR - FILE BUSY
1390 HOME
1400 VTAB 4
1410 PRINT "That catalog directory file is already open. It must be closed before it can beaccessed again."
1420 PRINT
1430 PRINT "I will close the file now. Please try again!"
1440 PRINT D$;"CLOSE"
1450 GOSUB 1770
1460 RETURN
1470 REM --CONTROL-C ATTEMPTED
1480 PRINT D$;"CLOSE"
1490 HOME : VTAB 4
1500 PRINT "A CONTROL-C interrupt has been detected - do you really want to halt the": PRINT "program?": PRINT : PRINT : PRINT "Please answer Yes or No (Y/N) -> ";: GET R$: PRINT R$
1510 IF R$ = "Y" OR R$ = "y" THEN PRINT CHR$(12); CHR$(21): PRINT CHR$(4);"CLOSE": VTAB 12: HTAB 18: PRINT "BYE!": VTAB 22: END
1520 IF R$ = "N" OR R$ = "n" THEN GOTO 140
1530 GOTO 1490
1540 REM --ERROR - SYNTAX
1550 HOME : VTAB 2
1560 LET A$ = "The file/pathname that you entered was": GOSUB 1870
1570 PRINT
1580 LET A$ = " " +DN$ +" ": INVERSE : GOSUB 1870: NORMAL
1590 PRINT : PRINT
1600 PRINT "Compare your path/filename above with the rules for naming path/filenames that appear below. Your path/filename MUST agree with these rules:"
1610 PRINT : PRINT
1620 HTAB 7: PRINT "1) The first character of the filename MUST be a letter."
1630 PRINT
1640 HTAB 7: PRINT "2) The maximum length of a filename is 15 characters."
1650 PRINT
1660 HTAB 7: PRINT "3) Only letters, digits, and periods are allowable as characters in a": PRINT " ProDOS filename. All others (including spaces) are illegal."
1670 PRINT
1680 HTAB 7: PRINT "4) The maximum length of a pathname is 64 characters including the": PRINT " slashes."
1690 PRINT : PRINT : PRINT
1700 GOSUB 1770
1710 RETURN
1720 REM --ERROR - UNABLE TO SET PREFIX
1730 IF PEEK(222) = 8 THEN HOME : VTAB 4: PRINT "Unable to set prefix for the current disk - a disk drive door must be open or else you have a faulty or non-ProDOS disk in the drive. Please correct the"
1740 IF PEEK(222) = 8 THEN PRINT "situation before trying again."
1750 GOSUB 1770
1760 POKE 216,0: RUN
1770 REM --PRESS <RETURN>
1780 POKE -16368,0: REM --CLEAR KEYBOARD STROBE
1790 VTAB 22
1800 LET A$ = " Press <RETURN> to continue."
1810 HTAB 40 - LEN(A$)/2
1820 INVERSE
1830 PRINT A$;
1840 NORMAL
1850 GET R$: PRINT R$
1860 RETURN
1870 REM --CENTER A STRING
1880 HTAB 40 - LEN(A$)/2
1890 PRINT A$
1900 RETURN
1910 HOME : VTAB 8: PRINT DN$;" is not a directory.": PRINT "It cannot be cataloged."