Compucolor.org – Virtual Media

Listing of file='GETFIL.BAS;01' on disk='vmedia/catalog_32-sector.ccvf'

100 REM  	GETFIL	32	2,9,81
110 PLOT 12:CLEAR 4000
112 PLOT 6,48,14,3,8,0:PRINT "   F I L E   N A M E   E X T R A C T I O N   " :PLOT 6,2,15,3,0,5
113 PRINT "SETTING UP THE FILES.":PRINT
120 ATR= 0:BB= 0:BP= 0:C2= 0:DD= 0:DR= 0:F1= 0:F2= 0:I= 0:J= 0:K= 0:L= 0:N1= 0:N2= 0:SZ= 0:TM= 0:Z= 0:Z1= 0:Z2= 0
130 B$= "":DN$= "":DR$= "":FS$= "":LA$= "":RR$= "":S1$= "":S2$= "":S3$= "":SB$= "":ST$= "":SZ$= ""
140 TM= PEEK (32940)+ PEEK (32941)* 256:DR= PEEK (TM+ 1):DR$= MID$ (STR$ (DR),2)+ ":"
150 BB= TM+ 3:Z= BB:GOSUB 560:LA$= B$
160 FILE "T",460
170 FILE "R",1,"INDEX.RND",1:GET 1,1;ST$[1]
180 FILE "R",2,"INDEX.INF",1:GET 2,1,9;N1,N2
190 FILE "R",3,"FILER",1:GET 3,1;ST$[1]
210 IF N1= 0THEN PRINT "EMPTY INDEX ":PRINT :GOTO 480
220 DD= 1:GOSUB 550
230 PRINT "FILING IN PROCESS...DO NOT DISTURB.":PRINT :FOR L= 1TO 200
240 GET 1,L;ST$[1]:IF ASC (ST$)= 0THEN 360
250 GET 1,L,11;S1$[1],S2$[1],S3$[1]:IF ASC (S1$)> 127AND DD= 1THEN 360
260 IF ASC (S1$)< 127AND DD= 2THEN 360
270 DN$= CHR$ (L):SZ= (ASC (S1$)AND 127):Z= SZ* 128:GOSUB 560:SZ$= B$
280 Z= ASC (S3$)* 256+ ASC (S2$):GOSUB 560:SB$= B$
290 PLOT 27,4:PRINT "REA"+ DR$+ " "+ SB$+ " "+ LA$+ " "+ SZ$:PLOT 27,27
300 FOR K= 1TO SZ:BP= BB+ (K- 1)* 128
310 FOR J= 2TO 107STEP 21:ATR= PEEK (BP+ J):IF ATR< > 3THEN 350
320 RR$= "":FOR I= 1TO 10:RR$= RR$+ CHR$ (PEEK (BP+ J+ I)):NEXT I
330 C2= C2+ 1
332 IF DR= 0AND ((C2/ 128)= INT (C2/ 128))THEN 430
335 IF C2= 2304THEN 630
340 PUT 3,C2;RR$[10],DN$[1]
350 NEXT J,K
360 NEXT L
370 IF DR= 0THEN GOSUB 540
372 IF DD= 2THEN F2= C2- F1:GOTO 380
374 F1= C2:IF N2= 0THEN 380
376 DD= 2:GOSUB 550:GOTO 230
380 Z2= INT (C2/ 256):Z1= C2- Z2* 256:FS$= CHR$ (Z1)+ CHR$ (Z2)
400 PUT 3,2304;FS$[2]:GOTO 470
430 GOSUB 540
440 IF DD= 1THEN PUT 3,C2;RR$[10],DN$[1]:GET 3,C2+ 1;ST$[1]:GOTO 450
445 PUT 4,C2;RR$[10],DN$[1]:GET 4,C2+ 1;ST$[1]
450 GOSUB 550:GOTO 350
460 PRINT "FILE ERROR!":PRINT
470 IF DR= 0THEN GOSUB 540
480 FILE "C",1,2,3
490 IF N1= 0THEN PLOT 1
500 PRINT "FILE NAMES NOW STORED":PRINT
510 PRINT F1" FROM DATA DISK #1 AND"F2" FROM DATA DISK #2":PRINT
520 INPUT "PRESS ENTER TO CARRY OUT SORT. ";Z
530 PLOT 27,4:PRINT "RUN QSORT"
540 PRINT "INSERT PROGRAM DISK IN CD0:":INPUT "";YN$:RETURN
550 PRINT "INSERT DATA DISK #"DD" IN CD"DR$"":INPUT "";YN$:RETURN
560 B$= "":Z2= Z
580 Z1= Z2- INT (Z2/ 16)* 16:Z2= INT (Z2/ 16)
590 IF Z1< 10THEN B$= CHR$ (48+ Z1)+ B$
600 IF Z1> 9THEN B$= CHR$ (55+ Z1)+ B$
610 IF Z2= 0THEN RETURN
620 GOTO 580
630 PRINT :PRINT "RECORD OVERFLOW!...FROM DATA DISK #"DD"":PRINT
640 PRINT "MAXIMUM FILE NAMES ALLOWABLE = 2303!":PRINT :GOTO 370