0DIM DUPL$(20),PRO$(9),LIBFILE$(10),MUNIQUE(500),NUNIQUE(500),INF$(112)
1 DIM B$(10),A$(14),BIT(15)
2 VERSION$="2.1":DOT$="."
3 GOTO 20010
1000 '
1001 '
1002 ' menu processor
1003 ' input vars:NC # of menu choices, TITLE$- menu title,
1004 '           :PRO$(NC)- prompts for each menu choice
1005 '           :EXPERT-   0 (confirm reqd)  1(no confirm required)
1006 '      display program header, date and time-- then menu title
1007 '
1010 SCREEN 0:LN$="\"+SPACE$(SCWD-2)+"\":DEF FNA(X$)=SCWD/2-LEN(X$)/2
1015 KEY OFF :CHOICE=-1
1020 GOSUB 1510 'print program header
1025 LOCATE 4, FNA(TITLE$) : COLOR 15,0 : PRINT TITLE$ : COLOR 7,0 'print menu title
1030 GOSUB 1110  ' print selection prompts
1035 LOCATE 19, 1: IF EXPERT THEN PRINT "Expert mode    : Type a number to make your choice                         "
1038 IF EXPERT<>1 THEN LOCATE 19,1:PRINT"Beginner's mode: Type a number to light up your choice then press enter."
1040 COLOR 7,0: CM$="" : WHILE CM$="" : CM$=INKEY$ : WEND
1045 IF ASC(CM$)=27 THEN CHOICE = 69 : RETURN  'quit if ESC
1050 '
1055 ' check for input validity and if ok return  else try again
1060 '
1065 CM = ASC(CM$) - ASC("0") :IF CM >=0 AND CM <=NC THEN CHOICE = CM
1070 IF (CHOICE<>0) THEN GOTO 1099
1080 EXPERT=1-EXPERT
1085 GOTO 1030
1099 IF (EXPERT OR CM$=CHR$(13)) AND (CHOICE>=0) THEN RETURN ELSE 1030
1100 '
1105 ' print centered selection prompts
1109 '
1110 LONGEST = 0 : FOR I = 1 TO NC : IF LEN(PRO$(I))>LONGEST THEN LONGEST = LEN(PRO$(I))
1120 NEXT I : XP = (SCWD/2-2)-LONGEST/2
1125 LOCATE 6,XP:PRINT "0.                    ";:LOCATE 6,XP+3:IF EXPERT=0 THEN PRINT"Change to expert mode        ";
1130 IF EXPERT=1 THEN PRINT "Change to beginner's mode"
1135 FOR I=1 TO NC:LOCATE 6+I,XP:IF CHOICE=I THEN COLOR 31,0 ELSE COLOR 7,0
1199 PRINT CHR$(48+I);". "; PRO$(I) : NEXT I : COLOR 7,0:RETURN
1400 '
1401 ' pause routine
1402 '
1410 IF N<=0 OR N>1000 THEN N=5
1415 NN=N*10
1420 SOUND 32700,NN:SOUND 32700,2
1499 RETURN
1500 '
1502 ' title line  Input vars:PROGNAME$, SCWD(screen width), QUIET(1 suppresses
1504 ' Internal variables:none Output variables:none
1506 ' SBR function:  prints program name, date and time inverse at screen top
1508 '
1510 CLS:IF QUIET THEN RETURN ELSE COLOR 0,7 : PRINT
1515 LOCATE 1,1:PRINT "  "+PROGNAME$;TAB(SCWD-15);"Date:";DATE$
1520 LOCATE 2,1:PRINT"Store library file on drive ";DRLIB$;"     Read disks in drive ";DRCAT$
1525 LOCATE 2,SCWD-15:PRINT"Time:  ";TIME$
1599 PRINT: COLOR 7,0 : RETURN
1900 '
1902 ' Await key press to continue
1904 '
1910 LOCATE 22,15:PRINT"Press any key to continue"
1915 V$=INKEY$:IF V$="" THEN GOTO 1910
1999 RETURN
2000 '
2001 '  ERROR HANDLING ROUTINES
2002 '
2009 '               BAD FILE NAME
2010 ER=ERR:EL=ERL
2011 IF(ERR<>52) AND (ERR<>64) THEN 2012 ELSE LOCATE 24,1:PRINT"Invalid file name";:FOR I=1 TO 2000:NEXT I:LOCATE 24,1:PRINT SPACE$(80):RESUME
2012 IF(ERR<>58 AND ERL<>19010) THEN 2013 ELSE RESUME 19011
2013 IF(ERR<>53 AND ERL<>19010) THEN 2015 ELSE RESUME 19012
2015 IF ERR<>53 THEN 2020 ELSE LOCATE 24,1:PRINT"Do you have the right disk in the drive and the correct file name?";:FOR I=1 TO 2000:NEXT I:LOCATE 24,1:PRINT SPACE$(80):RESUME
2020 IF ERR<>61 THEN 2025 ELSE LOCATE 23,1:PRINT"The disk appears to be full."
2021 IF EL=5240 THEN PRINT"Please insert a non-full disk in the drive and press ENTER":INPUT AA$:CLS:RESUME 5210
2022 PRINT"You should start cataloging from the beginning on a fresh diskette":FOR I=1 TO 1000:NEXT I:END
2025 IF ERR<>70 THEN 2030 ELSE LOCATE 24,1:PRINT"The disk is write-protected. Please insert the correct diskette.":FOR I=1 TO 2000:NEXT I:LOCATE 24,1:PRINT SPACE$(80):RESUME
2030 IF ERR<>71 THEN 2040 ELSE LOCATE 22,1:PRINT"Check the drives to be sure the door is closed and a diskette is inside.":PRINT"Press ENTER to continue.";:INPUT AA$:LOCATE 22,1:PRINT SPACE$(75):PRINT SPACE$(75)
2031 IF EL=5220 THEN RESUME 5220 ELSE RESUME 6530
2040 PRINT"ERR=";ERR;" ERL=";EL
2042 END
2099 RETURN
2300 '
2301 '   TITLE PAGE SUBROUTINE
2302 '
2310 CLS
2315 LOCATE 2,40:PRINT"PC-LIB":LOCATE 4,25:PRINT"Copyright(c) 1983 by John Dannenfeldt"
2320 LOCATE 5,39:PRINT"Version ";VERSION$
2325 LOCATE 10,15:PRINT"If you are using this program and find it to be of value,":LOCATE 11,15:PRINT"suggestions would be appreciated."
2330 LOCATE 14,35:PRINT"John C. Dannenfeldt"
2335 LOCATE 15,35:PRINT"1240 10th Street"
2340 LOCATE 16,35:PRINT"Silvis, IL 61282"
2345 LOCATE 21,15:PRINT"You are encouraged to copy and share this program with others."
2347 LOCATE 18,15:PRINT"The latest version will always be available on the QCPC BBS":LOCATE 19,15:PRINT"at 1-319-332-7648 or 1-309-796-2214"
2349 GOSUB 19010
2350 GOSUB 1900
2399 RETURN
5000 '
5001 '  display disk libraries currently on disk
5002 '
5010 FI$=DRLIB$+":"+"***.dta"
5011 SCREEN ,,0,0:GOSUB 1510:PRINT" Current library files are:":SCR$="":I=1:LOCATE 6,1:FILES FI$
5099 GOSUB 1910:RETURN
5200 '
5201 ' Open new library .HDR file
5202 '
5210 C$=CHR$(13)+CHR$(10)
5216 S1$="NAME"+C$+" 8 "+C$+"EXT"+C$+" 3 "+C$+"MO#"+C$+" 2 "+C$+"DA#"+C$+" 2 "
5217 S2$=C$+"YEAR#"+C$+" 4 "+C$+"SIZE#"+C$+" 6 "+C$+"REQ"+C$+" 6 "+C$+"DOSV#"+C$+" 1 "+C$+"FN#"+C$+" 2 "+C$
5218 S3$="DESCRIPTION"+C$+" 21 "+C$+"VOL"+C$+" 6 "+C$+CHR$(26)+STRING$(38,0)
5219 S$=S1$+S2$+S3$
5220 OPEN LFD$+".HDR" FOR OUTPUT AS #1:PRINT #1,S$:CLOSE
5299 RETURN
6100 '
6101 ' create new library file
6102 '
6110 OP=0:R%=1
6120 GOSUB 1510:LOCATE 4,1:PRINT SPACE$(30)+"CREATE NEW LIBRARY FILE"
6125  PRINT:PRINT"You will be asked to insert each disk once for cataloging.":PRINT"Please be sure to only catalog the disks you want in this library file!"
6130 LOCATE 10,5:INPUT"What name would you like to give this library file";LFD$:IF LEN(LFD$) >8 OR LEN(LFD$)<1 OR LFD$="" THEN GOTO 6130
6135 FIDTA$=DRLIB$+":"+LFD$+".DTA"
6140 FL=0
6141 GOSUB 5210
6142 LOCATE 12,5
6145 IF FL=0 THEN PRINT"Would you like to start cataloging your disks";:ELSE GOSUB 1510:PRINT"Would you like to catalog another disk? (Y/N)";:
6150 INPUT I$
6155 IF ((I$="y") OR (I$="Y")) THEN GOTO 6170
6160 IF ((I$="n") OR (I$="N")) THEN 6195
6165 GOTO 6145
6170 FL=1
6175 LOCATE 16,5:PRINT "Insert disk in drive ";DRCAT$;" and press return";:INPUT I$
6180 GOSUB 6310  ' read files off one disk
6194 GOTO 6145
6195 GOSUB 6710  ' close new library file
6199 RETURN
6300 '
6301 '  read FAT from one disk
6302 '
6310 SCREEN 0:KEY OFF
6315 IF DRCAT$="A" THEN DISK%=1  '1 for drive A
6316 IF DRCAT$="B" THEN DISK%=2  '2 for drive B
6317 IF DRCAT$="C" THEN DISK%=3  '3 for drive C
6320 DEF SEG=&H2100  'Dependent upon your memory
6325 INIT%=2:GETNEXT%=5:FILENAME$="???????????"
6330 CALL INIT%(DISK%,FILENAME$):N=1
6335 FILENAME$=SPACE$(14):CALL GETNEXT%(FILENAME$,STATUS%)
6340 IF (( STATUS%<=0) AND (FILENAME$=SPACE$(14))) THEN GOTO 6390
6341 B%=PEEK(0)+PEEK(1)*256 ' get offset value
6342 FDATE=PEEK(B%+26)*256+PEEK(B%+25)
6343 FTIME=PEEK(B%+24)*256+PEEK(B%+23)
6344 FSIZE$=STR$(32768!*PEEK(B%+31)+256*PEEK(B%+30)+PEEK(B%+29))
6345 BIT(0)=(FDATE AND 1)/1:BIT(1)=(FDATE AND 2)/2:BIT(2)=(FDATE AND 4)/4:BIT(3)=(FDATE AND 8)/8:BIT(4)=(FDATE AND 16)/16:BIT(5)=(FDATE AND 32)/32:BIT(6)=(FDATE AND 64)/64:BIT(7)=(FDATE AND 128)/128:BIT(8)=(FDATE AND 256)/256
6346 BIT(9)=(FDATE AND 512)/512:BIT(10)=(FDATE AND 1024)/1024:BIT(11)=(FDATE AND 2048)/2048:BIT(12)=(FDATE AND 4096)/4096:BIT(13)=(FDATE AND 8192)/8192:BIT(14)=(FDATE AND 16384)/16384:BIT(15)=0
6347 DAY$=STR$(BIT(0)+2*BIT(1)+4*BIT(2)+8*BIT(3)+16*BIT(4))
6348 DAY$=RIGHT$(DAY$,2)
6350 MONTH$=STR$(BIT(5)+2*BIT(6)+4*BIT(7)+8*BIT(8))
6351 MONTH$=RIGHT$(MONTH$,2)
6352 YRS$=STR$(BIT(9)+2*BIT(10)+4*BIT(11)+8*BIT(12)+16*BIT(13)+32*BIT(14)+64*BIT(15)+1980):YEAR$=RIGHT$(YRS$,4)
6354 IF STATUS%=8 THEN VOL$=MID$(FILENAME$,3,6): GOTO 6335
6355 NME$=RIGHT$(FILENAME$,LEN(FILENAME$)-2)
6360 LOCA=INSTR(NME$,DOT$):EXT$=MID$(NME$,LOCA+1,3):NME$=LEFT$(NME$,LOCA-1)
6365 GOSUB 6610:IF DU=1 THEN GOTO 6335
6370 SIZE$=STR$(VAL(FSIZE$)):LOCATE 19,1:PRINT NME$;EXT$;DAY$;MONTH$;YEAR$;SIZE$
6375 INF$(N)=NME$+SPACE$(8-LEN(NME$))+EXT$+SPACE$(3-LEN(EXT$))+MONTH$+SPACE$(2-LEN(MONTH$))+DAY$+SPACE$(2-LEN(DAY$))+YEAR$+SPACE$(4-LEN(YEAR$))+SIZE$+SPACE$(6-LEN(SIZE$))
6380 N=N+1
6385 GOTO 6335
6390 CLOSE:FP$=FIDTA$
6391 PRINT"Is   ";VOL$;"   the correct volume name for this disk";:INPUT;ANS$
6392 IF((LEFT$(ANS$,1)="Y") OR (LEFT$(ANS$,1)="y")) THEN GOTO 6395
6393 PRINT:INPUT"Type in a volume name- 6 characters please";VOL$:IF VOL$="" THEN GOTO 6393
6395 FOR I=1 TO N-1:I$=INF$(I)+SPACE$(30)+VOL$+CHR$(13):GOSUB 6510:R%=R%+1:NEXT I
6396 CLOSE:O2=0
6399 RETURN
6500 '
6501 ' add program data to library file
6502 '
6510 IF O2=1 THEN GOTO 6520
6515 OPEN FP$ AS #2 LEN=62:O2=1
6520 FIELD #2,62 AS DT$:LSET DT$=I$:PUT #2,R%
6599 RETURN
6600 '
6601 ' check for duplicate files
6602 '
6610 DU=0
6623 STRI$=NME$+"."+EXT$
6625 FOR Q=1 TO ND
6626 IF (LEFT$(STRI$,LEN(DUPL$(Q)))=DUPL$(Q)) THEN DU=1
6629 NEXT Q
6699 RETURN
6700 '
6701 ' close new library file correctly
6702 '
6710 CLOSE
6715 OPEN FIDTA$ AS #1 LEN=62
6720 FIELD #1,1 AS F$,59 AS D$
6725 FA$=CHR$(92):DA$=SPACE$(61)
6730 LSET F$=FA$
6735 LSET D$=DA$
6740 PUT #1,R%
6745 CLOSE
6799 RETURN
6800 '
6801 ' Duplicate file definitions
6802 '
6810 GOSUB 1510:LOCATE 5,1:PRINT"Since some files like IBMDOS.COM are on many or most disks,":PRINT"we allow you to define 20 file names that you don't really care to catalog."
6812 ND=6
6815 PRINT"The current duplicate file names are:"
6820 FOR Q=1 TO 10:LOCATE 8+Q,10:PRINT DUPL$(Q) TAB(30) DUPL$(Q+10):NEXT Q
6825 PRINT"Would you like to add to the list";:INPUT AN$
6830 IF LEFT$(AN$,1)="Y" OR LEFT$(AN$,1)="y" THEN GOTO 6835
6831 RETURN
6835 LOCATE 20,10:INPUT"Additional file name";DUPL$(ND+1)
6840 LOCATE 21,10:INPUT"More additions?";AN$:ND=ND+1:IF AN$="y" OR AN$="Y" THEN 6845 ELSE GOTO 6899
6845 LOCATE 19,10:PRINT SPACE$(40):PRINT SPACE$(40):PRINT SPACE$(40):LOCATE 20,10:GOTO 6820
6899 RETURN
6900 '
6901 '  Change default drives
6902 '
6910 GOSUB 1510
6915 OLIB$=DRLIB$:OCAT$=DRCAT$
6920 INPUT "Do you want to change the drive functions noted above";AN$:IF LEFT$(AN$,1)="Y" OR LEFT$(AN$,1)="y" THEN 6925 ELSE RETURN
6925 PRINT:INPUT"Store library file on drive ";DRLIB$:IF DRLIB$="" THEN 6925
6930 PRINT:INPUT"Read disks in drive ";DRCAT$:IF DRCAT$="" THEN 6930
6935 IF DRLIB$=DRCAT$ THEN PRINT "You can't do both in one drive! Try again!":GOTO 6955 ELSE 6936
6936 UPLIB$=CHR$(ASC(DRLIB$)-32):UPCAT$=CHR$(ASC(DRCAT$)-32)
6938 IF (ASC(DRLIB$)>96) THEN DRLIB$=UPLIB$
6939 IF (ASC(DRCAT$)>96) THEN DRCAT$=UPCAT$
6950 IF((LEN(DRLIB$)<>1) OR(LEN(DRCAT$)<>1)) THEN 6955
6951 LIBA=ASC(DRLIB$):CATA=ASC(DRCAT$)
6953 IF((LIBA<65) OR (CATA<65)) THEN LOCATE 22,1:PRINT"Please use rational drive letters only!!":GOTO 6955
6954 RETURN
6955 GOSUB 1910:LOCATE 22,1:PRINT SPACE$(80):DRLIB$=OLIB$:DRCAT$=OCAT$:GOTO 6910
7000 '
7001 ' Program instructions
7002 '
7010 GOSUB 1510
7015 PRINT"PURPOSE--":PRINT"This program allows you to create a diskfile of all your programs":PRINT"by reading the directory off each disk you catalog, assigning a volume name":PRINT"and writing it to a file that may be manipulated by PC-FILE-- a"
7017 PRINT"public domain database program available from Jim Button"
7019 PRINT:PRINT"DEFAULT FILE NAMES--":PRINT"Since some file names like IBMDOS.COM are on":PRINT"many or most disks, we allow you to define 20 file names":PRINT"that you don't really care to catalog."
7020 PRINT:PRINT"After you create your library file you must use PC-FILE to sort":PRINT"it before PC-FILE can produce reports on your disk library."
7025 PRINT:PRINT"Remember to start BASIC/S:1024 so there is enough buffer space!!"
7030 GOSUB 1910
7099 RETURN
11000 '
11002 ' Compare and annotate files
11004 '
11010 O1=0:O2=0:O3=0:O4=0:GOTO 11240
11015 GOSUB 1510
11030 '
11035 IF O1=1 THEN GOTO 11045
11040 OPEN FG$ AS #1 LEN=26:O1=1
11045 IF EOF(1) THEN MDONE=1:GOTO 11055
11050 FIELD #1,2 AS MINAME$,20 AS REST$,4 AS MD$:GET #1,R%:MD=VAL(MD$)
11055 RETURN
11060 '
11065 IF O2=1 THEN GOTO 11075
11070 OPEN FG$ AS #2 LEN=26:O2=1
11075 IF EOF(2) THEN NDONE=1:GOTO 11085
11080 FIELD #2,2 AS NINAME$,20 AS REST$,4 AS ND$:GET #2,R%:ND=VAL(ND$)
11085 RETURN
11090 '
11095 IF O3=1 THEN GOTO 11105
11100 OPEN FG$ AS #3 LEN=62:O3=1
11105 FIELD #3,11 AS MNAME$,51 AS MREST$:GET #3,R%:RETURN
11110 '
11115 IF O4=1 THEN GOTO 11125
11120 OPEN FG$ AS #4 LEN=62:O4=1
11125 FIELD #4,11 AS NNAME$,51 AS NREST$:GET #4,R%:RETURN
11150 '
11155 IF O1=1 THEN GOTO 11165
11160 OPEN FG$ AS #1 LEN=62:O1=1
11165 FIELD #1,62 AS DTA$:GET #1,R%:RETURN
11170 '
11190 '
11195 GOSUB 1510:LOCATE 4,1:PRINT"This program will compare any two library files CAT1.DTA and CAT2.DTA":PRINT"created by this version of PC-LIB"
11200 PRINT:PRINT"It is suggested that you operate this program from electronic disk since":PRINT"it does a great deal of disk reading and writing and will run faster and":PRINT"cause less disk wear on an electronic disk."
11205 PRINT:PRINT"The disk (electronic or real) should contain these programs:":PRINT"   CAT1.DTA":PRINT"   CAT1.INX":PRINT"   CAT2.DTA":PRINT"   CAT2.INX":PRINT"   BASIC.COM"
11210 PRINT"   and this program- PC-LIB.BAS":PRINT:PRINT"These programs will take up about 100K of space so a  128K or 196K ":PRINT"electronic disk is suggested to allow adequate room for the resulting files":GOSUB 1910
11215 GOSUB 1510:PRINT"This program will create on the disk the program runs from two sets of PC-LIB":PRINT"formatted files:":PRINT:PRINT"UNIQUE1.DTA contains all the entries found only in the CAT1.DTA":PRINT"file on comparison."
11220 PRINT:PRINT"UNIQUE2.DTA contains all the programs found only in CAT2.DTA":PRINT:PRINT"You will need the accompanying header files CAT1.HDR and CAT2.HDR":PRINT"when you use PC-FILE to examine CAT1.DTA and CAT2.DTA":GOSUB 1910
11225 GOSUB 1510:PRINT"For your convenience, below is a BAT file listing that can be used to load":PRINT"the electronic disk with the necessary programs and start the program":PRINT"Please note the parameters needed when you use BASIC"
11230 PRINT:PRINT"It assumes that you use CAT1.DTA and CAT2.DTA as the names for your library files":PRINT"and that you use C: as your electronic disk":PRINT
11235 PRINT"       COPY A:CAT1.* C:":PRINT"       COPY A:CAT2.* C:":PRINT"       COPY A:BASIC.COM C:":PRINT"       COPY A:PC-LIB.BAS C:":PRINT"       BASIC C:COMPARE.BAS/S:1024/F:4":GOSUB 1910:RETURN
11240 'Setup
11255 GOSUB 1510:INPUT"Do you need instructions";AA$:IF LEFT$(AA$,1)="Y" OR LEFT$(AA$,1)="y" THEN GOSUB 11190
11260 CLOSE
11265 GOSUB 1510:LOCATE 3,1:PRINT"What is the name of the first library file to be compared":INPUT;CAT1$:X=INSTR(CAT1$,"."):IF X<>0 THEN GOTO 11280
11270 IF LEN(CAT1$)>8 THEN GOTO 11265
11275 CAT1ROOT$=CAT1$:GOTO 11285
11280 CAT1ROOT$=LEFT$(CAT1$,X-1)
11285 CAT1INX$=CAT1ROOT$+".inx":CAT1DTA$=CAT1ROOT$+".dta"
11290 LOCATE 5,1:PRINT"What is the name of the library file to be compared with ";CAT1DTA$;:INPUT;CAT2$:X=INSTR(CAT2$,"."):IF X<>0 THEN GOTO 11305
11295 IF LEN(CAT2$)>8 THEN GOTO 11290
11300 CAT2ROOT$=CAT2$:GOTO 11310
11305 CAT2ROOT$=LEFT$(CAT2$,X-1)
11310 CAT2INX$=CAT2ROOT$+".inx":CAT2DTA$=CAT2ROOT$+".dta":PRINT:PRINT"Would you like a file of all programs unique to ";CAT1DTA$;:INPUT;UN1$:PRINT:PRINT"Would you like a file of all programs unique to ";CAT2DTA$;:INPUT;UN2$
11315 PRINT:PRINT"Would you like to annotate ";CAT2DTA$;" with the descriptions from ";CAT1DTA$;:INPUT;ANNO$:GOSUB 1510:LOCATE 3,1:PRINT"To compare library files they must be sorted correctly first.":PRINT"the correct sort order is:":PRINT"  Name"
11317 PRINT"Ext"
11320 INPUT"Is the new file sorted in this order";ANS$:A$=LEFT$(ANS$,1):IF A$<>"n" OR A$<>"N" THEN GOTO 11330
11325 PRINT"Sort ";NEWROOT$;" correctly using PC-FILE and then run this program again":END
11330 PRINT"Preparing files....":LFD$="unique1":GOSUB 5210:LFD$="unique2":GOSUB 5210:M=1:N=1:MU=1:NU=1:PRINT"Comparing files...."
11335 R%=M:FG$=CAT1INX$:GOSUB 11030:R%=N:FG$=CAT2INX$:GOSUB 11060:IF MDONE AND NDONE THEN GOTO 11410
11340 IF MDONE THEN GOTO 11400
11345 IF NDONE THEN GOTO 11390
11350 IF(NINAME$>MINAME$) THEN GOTO 11390
11355 IF(MINAME$>NINAME$) THEN GOTO 11400
11360 IF LEFT$(MINAME$,1)="\" AND LEFT$(NINAME$,1)="\" THEN GOTO 11410
11365 R%=MD:FG$=CAT1DTA$:GOSUB 11090:R%=ND:FG$=CAT2DTA$:GOSUB 11110:LOCATE 18,1:PRINT MNAME$,NNAME$:IF(NNAME$>MNAME$) THEN GOTO 11390
11370 IF(MNAME$>NNAME$) THEN GOTO 11400
11375 IF ((ANNO$<>"Y") AND (ANNO$<>"y")) THEN GOTO 11385
11380 INFO$=MID$(MREST$,15,30):DN$=MID$(NREST$,1,14):DE$=MID$(NREST$,45,7):NE$=NNAME$+DN$+INFO$+DE$:PRINT NE$:FP$=CAT2DTA$:R%=ND:I$=NE$:CLOSE #2:O2=0:GOSUB 6510:CLOSE #2:O2=0
11385 M=M+1:N=N+1:GOTO 11335
11390 'master unique
11395 MUNIQUE(MU)=MD:MU=MU+1:M=M+1:GOTO 11335
11400 'new unique
11405 NUNIQUE(NU)=ND:NU=NU+1:N=N+1:GOTO 11335
11410 'create unique files
11415 CLOSE:O1=0:O2=0:O3=0:O4=0:IF ((UN1$<>"Y") AND (UN1$<>"y")) THEN GOTO 11425
11420 FG$=CAT1DTA$:FP$="unique1.dta":CLS:PRINT"Programs unique to ";CAT1DTA$:FOR N=1 TO MU-1:R%=MUNIQUE(N):GOSUB 11150:I$=DTA$:PRINT"M UNIQUE(";N;")= ";DTA$:R%=N:GOSUB 6510:NEXT N:R%=MU:I$="\"+SPACE$(61):GOSUB 6510:CLOSE:O1=0:O2=0
11425 ' create nunique
11427 GOSUB 1910
11430 IF ((UN2$<>"Y") AND (UN2$<>"y")) THEN GOTO 11440
11435 FG$=CAT2DTA$:FP$="unique2.dta":CLS:PRINT"Programs unique to ";CAT2DTA$:FOR N=1 TO NU-1:R%=NUNIQUE(N):GOSUB 11150:I$=DTA$:PRINT"N UNIQUE(";N;")= ";DTA$:R%=N:GOSUB 6510:NEXT N:R%=NU:I$="\"+SPACE$(61):GOSUB 6510
11440 GOSUB 1910:CLOSE:RETURN
19000 '
19002 'CREATE FAT READING PROGRAM
19004 '
19010 NAME "FATREAD.BIN" AS "FATREAD.BIN"
19011 DEF SEG=&H2100:BLOAD"FATREAD.BIN",0:RETURN
19012 OPEN "R", #1,"FATREAD.BIN",1
19013 FIELD #1, 1 AS N$
19014 READ N:LL=(N/28)+1
19016 FOR I = 1 TO N
19018 READ X$,CHECK:FOR C=1 TO LEN(X$) STEP 2:CC$="&H"+MID$(X$,C,2):IF CHECK=9999 THEN 19024
19020 LSET N$=CHR$(VAL(CC$)):PUT #1:CHECK=CHECK-VAL(CC$):NEXT C:IF CHECK<>0 THEN 19052
19022 NEXT I:CLOSE
19024 GOTO 19056
19026 DATA  292
19028 DATA FD001700001C012401EB3590EB6490FF00000000003F000000000000,1571
19030 DATA 00000000000000000000000000000000000000000000000000000000,0
19032 DATA 0000000000000000558BEC1E8CC88ED833F6268B5E06268B5F01268A,2211
19034 DATA 00888410004683FE0B7CF38B7608268B04A20F0032C0A238001F5DCA,2526
19036 DATA 0400558BEC1E8CC88ED8FA892636008C1634008ED0BCCC01FBBA1D01,3095
19038 DATA B41ACD21BA0800803E3800007508FE0?3800B411EB02B412CD213C00,2255
19040 DATA 7560268B5E0826803F0E7551268B5F0133FF8BF78BCFB06002062401,2561
19042 DATA 2688014726C6013A478A8425013C20740626880147EB0C80F9007507,2128
19044 DATA FEC126C6012E474683FE08750C80F9007507FEC126C6012E4783FE0B,3091
19046 DATA 7CCFA0300132E4EB03B8FFFFEB03B8FEFF268B5E06268907FA8E1634,3606
19048 DATA 008B263600FB1F5DCA04001A,838
19050 DATA 000000,9999
19052 PRINT "* * ERROR VERIFY FOLLOWING DATA * * * "
19054 PRINT X$;",";CHECK 
19056 CLOSE
19060 DEF SEG=&H2100:BLOAD"FATREAD.BIN",0
19099 RETURN
20000 '
20001 ' Initialization
20002 '
20010 DUPL$(1)="BASIC.COM":DUPL$(2)="BASICA.COM"
20032 DUPL$(3)="COMMAND.COM":DUPL$(4)="IBMBIO.COM"
20034 DUPL$(5)="IBMDOS.COM":DUPL$(6)="SD.COM"
20040 ND=6
20045 FAT=0
20050 DRLIB$="B":DRCAT$="A"
20060 DEF SEG=0:POKE &H417,PEEK(&H417) OR &H40
20085 ON ERROR GOTO 2010
21000 '
21001 'main program calling menu processor
21002 '
21010 SCREEN 0:KEY OFF
21017 GOSUB 2310
21020 SCWD=80:PROGNAME$="         PC-LIB   Multidisk Librarian"
21025 EXPERT=0:NC=7:TITLE$="Main Menu"
21030 PRO$(1) = "Create new library file"
21035 PRO$(2) = "Display current library files"
21040 PRO$(3) = "Redefine duplicate file list"
21045 PRO$(4)="Change default drives"
21050 PRO$(5)="Leave this program"
21053 PRO$(6)="Program instructions"
21054 PRO$(7)="Compare two library files and annotate"
21055 GOSUB 1010
21060 IF CHOICE=1 THEN GOSUB 6110
21065 IF CHOICE=2 THEN GOSUB 5010
21070 IF CHOICE=3 THEN GOSUB 6810
21075 IF CHOICE=4 THEN GOSUB 6910
21080 IF CHOICE=5 THEN 30000
21083 IF CHOICE=6 THEN GOSUB 7010
21084 IF CHOICE=7 THEN GOSUB 11010
21085 GOTO 21055
30000 CLS:GOSUB 1510:LOCATE 10,1:PRINT"Remember to sort your new disk library file:";LFNA$:LOCATE 11,1:PRINT"before using any other PC-File features":GOSUB 1910
30005 END