Compucolor.org – Virtual Media

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

100 REM  *****************************************************.
110 REM  *                                                   *.
120 REM  *             DIRECTORY MOVE PROGRAM                *.
130 REM  *                                                   *.
140 REM  *              BY : GORDON RUSCH                    *.
150 REM  *                   BUFFALO, N.Y.                   *.
160 REM  *                   (716)674-8551                   *.
170 REM  *                                                   *.
180 REM  *              FILESPEC:( DIRMOV )                  *.
190 REM  *                                                   *.
200 REM  *              ---------d---------                  *.
210 REM  *                                                   *.
220 REM  *  THIS PROGRAM WILL:                               *.
230 REM  *       (1) SAVE DIRECTORY ON SAME DISK             *.
240 REM  *       (2) SAVE DIRECTORY ON 'DIR. DISK'           *.
250 REM  *       (3) RETRIEVE DIRECTORY FROM SAME DISK       *.
260 REM  *       (4) RETRIEVE DIRECTORY FROM 'DIR. DISK'     *.
270 REM  *       (5) SCAN DIRECTORY DISK FOR ALL FILES       *.
280 REM  *                                                   *.
290 REM  *                   [8/20/79]                       *.
300 REM  *  829A-A3C0                                 8.47K  *.
310 REM  *****************************************************.
320 REM
330 REM
340 REM  ------------------ MAIN PROGRAM ---------------------.
350 REM
360 REM
370 CLEAR :CL= 3:D4= 43008:GOTO 440
380 PLOT 27,4:PRINT "REA "0" A800 "H$:PLOT 27,27
390 PLOT 27,4:PRINT "WRI "B$" A800 "H$:PLOT 27,27
400 PRINT "D O N E":PRINT :RETURN
410 REM  --------------------------------------------------.
420 REM  MENU AND QUESTIONS ROUTINE.
430 REM  --------------------------------------------------.
440 PLOT  14,12,6,CL:B$= "0186":FF= 0:JJ= 0
450 PRINT TAB( 10);"DIRECTORY d STORE & RETRIEVE d PROGRAM"
460 PLOT 15:GOSUB 480:GOSUB 500:GOSUB 520:GOSUB 540
470 GOSUB 560:GOSUB 580:GOTO 600
480 PLOT 3,0,5,6,CL:PRINT "1) SAVE PRESENT DIRECTORY ON ";
490 PRINT "SAME DISK.":RETURN
500 PLOT 3,0,7,6,CL:PRINT "2) RETRIEVE STORED DIRECTORY ";
510 PRINT "FROM SAME DISK.":RETURN
520 PLOT 3,0,9,6,CL:PRINT "3) RETRIEVE STORED DIRECTORY ";
530 PRINT "FROM 'DIR. DISK'.":RETURN
540 PLOT 3,0,11,6,CL:PRINT "4) SAVE PRESENT DIRECTORY ON ";
550 PRINT "'DIR. DISK'.":RETURN
560 PLOT 3,0,13,6,CL:PRINT "5) SEARCH -> SCAN DIRECTORY ";
570 PRINT "DISK FOR ALL FILES.":RETURN
580 PLOT 3,0,15,6,CL:PRINT "6) INITIALIZE DIRECTORY DISK."
590 RETURN
600 PRINT :PRINT :PLOT 11,6,15,15
610 PRINT "PLEASE MAKE PROPER SELECTION: ";
620 PLOT 6,6:INPUT "";SE:CL= 70
630 IF SE< 1OR SE> 6THEN PLOT 28,28,28:GOTO 600
640 ON SEGOSUB 480,500,520,540,560,580:PLOT 3,0,19,6,2
650 ON SEGOTO 690,770,1350,1130,1560,2000
660 REM  ------------------------------------------------.
670 REM  SAVE DIR. ON SAME DISK.
680 REM  ------------------------------------------------.
690 PLOT 6,3:PRINT
700 PRINT "INSERT DISK YOU WISH TO SAVE DIR. FROM.":PRINT
710 INPUT "THEN PRESS ENTER : ";Q$:EL= 5:GOSUB 2300:GOSUB 1080
720 B$= "0":GOSUB 1010:GOSUB 1830:GOSUB 950
730 GOSUB 850:B$= "0186":GOSUB 380:GOTO 970
740 REM  ------------------------------------------------.
750 REM  RETRIEVE STORED DIR. FROM SAME DISK.
760 REM  ------------------------------------------------.
770 GOSUB 810:GOSUB 1080:GOSUB 1010:GOSUB 1830:B$= "0186"
780 GOSUB 950
790 GOSUB 850:GOSUB 1040:GOSUB 800:GOSUB 400:GOTO 970
800 PLOT 12,6,3,27,4:PRINT "DIR":PLOT 27,27:PRINT :RETURN
810 PLOT 6,2:PRINT :INPUT "PRESS ENTER WHEN READY: ";Q$
820 RETURN
830 REM  ------------------------------------------------.
840 REM  DEC. TO HEX CONVERSION ROUTINE.
850 REM  ------------------------------------------------.
860 H$= "":XX= X:FOR DD= 3TO 0STEP - 1
870 IF DD= 0THEN X1= XX:GOTO 890
880 X1= INT (XX/ 16^ DD):XX= XX- X1* 16^ DD
890 IF X1< 10THEN X1= X1+ 48:GOTO 910
900 X1= X1+ 55
910 H$= H$+ CHR$ (X1):NEXT DD
920 RETURN
930 REM  ------------------------------------------------.
940 REM  BLOCK SIZE (C), CONVERTED TO BYTES (X).
950 REM  ------------------------------------------------.
960 X= C* 128:RETURN
970 PRINT :PLOT 6,3:PRINT "WOULD YOU LIKE ANOTHER 'MENU'"
980 PRINT "JUST PRESS ENTER FOR YES: ";:INPUT Q$
990 IF Q$= "N"OR Q$= "NO"THEN END
1000 GOTO 370
1010 PLOT 27,4:PRINT "REA "B$" A800 80":PLOT 27,27
1020 D4= 43008
1030 AS= PEEK (D4+ 1)+ 1:C= AS:RETURN
1040 PLOT 27,4:PRINT "REA "B$" A800 "H$:PLOT 27,27
1050 PLOT 27,4:PRINT "WRI "0" A800 "H$:PLOT 27,27
1060 RETURN
1070 PLOT 12
1080 PLOT 15,6,25:PRINT :PRINT "PLEASE WAIT":PRINT :PLOT 6,3
1090 RETURN
1100 REM  -----------------------------------------------.
1110 REM  SAVE DIRECTORY ON 'DIR. DISK'.
1120 REM  -----------------------------------------------.
1130 PRINT :PRINT "INSERT DISK TO BE COPIED:":PRINT
1140 INPUT "THEN PRESS ENTER: ";Q$:JJ= 7:EL= 7
1150 PLOT 6,3:B$= "0":GOSUB 1010:GOSUB 1830:GOSUB 800
1160 GOSUB 950:GOSUB 850
1170 PLOT 27,4:PRINT "REA "B$" A800 "H$:PLOT 27,27
1180 PRINT :INPUT "WHAT IS THE NUMBER OF THIS DISK :";N
1190 JJ= 1:EL= 7:IF N< 1OR N> 64THEN 2260
1200 INPUT "WHICH SIDE IS IT. ( 1 OR 2 ). :";SD
1210 JJ= 2:EL= 6:IF SD< 1OR SD> 2THEN 2380
1220 PRINT :PRINT "INSERT SIDE ";SD;" OF DIRECTORY DISK"
1230 PRINT :INPUT "THEN PRESS ENTER:";Q$:JJ= 6:GOSUB 2160
1240 GOSUB 1250:GOTO 1300
1250 IF SD= SITHEN RETURN
1260 PLOT 6,1,15:PRINT "E R R O R!  ";:PLOT 6,3:PRINT
1270 PRINT "YOU ARE ON SIDE";SI", NOT SIDE";SD", OF 'DIR.";
1275 PRINT " DISK'."
1280 PLOT 6,2:EL= 8:GOTO 2280
1290 IF JJ= 6THEN PRINT :GOTO 1390
1300 X= N* 6
1310 HX$= H$:GOSUB 850
1320 PLOT 27,4:PRINT "WRI "H$" A800 "HX$:PLOT 27,27
1330 PLOT 27,4:PRINT "WRI "0" A800 "HX$:PLOT 27,27
1340 GOSUB 800:GOSUB 400:GOTO 970
1350 PRINT :INPUT "PLEASE ENTER DISK NUMBER: ";N
1360 JJ= 3:EL= 7:IF N< 1OR N> 64THEN 2260
1370 PRINT :INPUT "PLEASE ENTER SIDE NUMBER: ";SD
1380 JJ= 4:EL= 7:IF SD< 1OR SD> 2THEN 2380
1390 PRINT :PRINT "INSERT SIDE";SD" OF 'DIR. DISK'":PRINT
1400 INPUT "THEN PRESS ENTER:";Q$:JJ= 5:EL= 7:GOSUB 2160
1410 GOSUB 1250
1420 X= N* 6
1430 GOSUB 850:PLOT 27,4:PRINT "REA "H$" A800 80":HX$= H$
1440 PLOT 27,27:AS= PEEK (D4+ 1)+ 1:C= AS
1450 GOSUB 1830:GOSUB 950
1460 GOSUB 850:PLOT 27,4:PRINT "REA "HX$" A800 "H$:PLOT 27,27
1470 PLOT 27,4:PRINT "WRI "0" A800 "H$:PLOT 27,27
1480 GOSUB 800:PLOT 6,6
1490 INPUT "IS THIS THE CORRECT DIRECTORY :";W$
1500 IF W$= "N"THEN 1800
1510 PLOT 6,5:PRINT "INSERT DISK";N;" SIDE";SD:PLOT 6,2:PRINT
1520 HX$= H$:INPUT "THEN PRESS ENTER: ";Q$:GOTO 1330
1530 REM  --------------------------------------------.
1540 REM  DIRECTORY DISK SEARCH ROUTINE.
1550 REM  --------------------------------------------.
1560 PLOT 6,28:PRINT :PRINT "SELECT TYPE OF SEARCH ROUTINE:"
1570 PRINT :PRINT "1) - SELECTIVE SCAN.          ":PRINT
1580 PRINT "2) - SEQUENTIAL SCAN.         ":PLOT 6,6:EL= 7
1590 PLOT 3,30,20:INPUT "";ST:PLOT 6,3,3,0,26
1600 IF ST< 1OR ST> 2THEN GOSUB 2310:GOTO 1560
1610 ON STGOTO 1900,1620
1620 RS= 1:RE= 64:SD= 1
1630 BB= RS:X= RS* 6:Y= RE* 6:GOSUB 2310:GOSUB 1750:GOSUB 850
1640 GOSUB 850
1650 IF X> YTHEN 1730
1660 X= X+ 6:PLOT 27,4:PRINT "REA "H$" A800 300":PLOT 27,27
1670 GOSUB 1030:FF= 1:GOSUB 1830
1680 PLOT 27,4:PRINT "WRI "0" A800 300":PLOT 27,27:GOSUB 800
1690 PLOT 6,2
1700 PRINT "DIRECTORY FOR   DISK";BB"   SIDE";SD;""
1710 IF PR= 1THEN 2410
1720 BB= BB+ 1:GOTO 1640
1730 BB= RS:X= RS* 6:SD= SD+ 1:PRINT
1740 IF SD= 3THEN PLOT 6,49:PRINT "SEARCH COMPLETED:":GOTO 970
1750 PRINT :PRINT "INSERT SIDE";SD;" OF DIRECTORY DISK"
1760 PRINT :PLOT 6,2:INPUT "THEN PRESS ENTER: ";Q$
1770 JJ= 8:EL= 7:GOSUB 2160:GOSUB 1250:GOTO 1640
1780 PRINT "NO DIRECTORY STORED IN SECTION ";:PLOT 6,3
1790 PRINT H$;" FOR DISK";BB;" SIDE";SD:BB= BB+ 1:GOTO 1640
1800 PLOT 6,1,14:PRINT :PRINT "YOUR NUMBERS MUST BE INCORRECT"
1810 PLOT 6,3,15:PRINT :PRINT "T R Y  A G A I N"
1820 PLOT 6,2:INPUT "PRESS ENTER WHEN READY ";Q$:GOTO 970
1830 IF AS< 1OR AS> 10THEN 1880
1840 IF PEEK (43010)< > 65THEN 1880
1850 RETURN
1860 PLOT 6,1:PRINT :PRINT "E R R O R";:PLOT 6,3
1870 PRINT "  NO DIRECTORY FOUND":PLOT 6,2:GOTO 2280
1880 IF FF= 1THEN 1780
1890 GOTO 1860
1900 EL= 7:GOSUB 2310:PRINT :PRINT "WHICH SIDE OF 'DIR,";
1910 INPUT " DISK'. ";SD:PRINT
1920 INPUT "ENTER DISK RANGE, EG.(6,12).";RS,RE
1930 EL= 3:GOSUB 2310:Y= RE* 6:BB= RS:X= RS* 6
1940 PR= 0:INPUT "ARE YOU USING A PRINTER. ";PR$
1950 IF  LEFT$ (PR$,1)= "Y"THEN PR= 1:PLOT 6,3:GOTO 1750
1960 GOTO 1750
1970 REM  -----------------------------------------------.
1980 REM  DIRECTORY DISK INITIALIZE AREA.
1990 REM  -----------------------------------------------.
2000 J= 255:K= 1:L= 68:D3= 44032
2010 POKE D3,J:POKE D3+ 1,K:POKE D3+ 2,L
2020 PLOT 12,6,6:PRINT :PRINT
2030 PRINT "INSERT SIDE 1 OF DIRECTORY DISK"
2040 PRINT "THEN PRESS ENTER: ";:INPUT "";Q$
2050 PLOT 27,4:PRINT "WRI "186" AC00 80":PLOT 27,27
2060 PRINT :POKE D3+ 1,2
2070 PRINT "INSERT SIDE 2 OF DIRECTORY DISK"
2080 PRINT "THEN PRESS ENTER: ";:INPUT "";Q$
2090 PLOT 27,4:PRINT "WRI "186" AC00 80":PLOT 27,27
2100 PLOT 6,3,14:PRINT :PRINT "DIRECTORY INITIALIZED"
2110 PLOT 15,6,2:PRINT
2120 INPUT "PRESS ENTER TO CONTINUE: ";Q$:GOTO 370
2130 REM  ----------------------------------------------.
2140 REM  DIRECTORY DISK TEST AREA.
2150 REM  ----------------------------------------------.
2160 PLOT 27,4:PRINT "REA "186" AC00 80":PLOT 27,27:PRINT
2170 D3= 44032
2180 IF PEEK (D3)= 255AND PEEK (D3+ 2)= 68THEN 2230
2190 PLOT 6,1:PRINT "E R R O R!  ";:PLOT 6,3
2200 PRINT "NOT DIRECTORY DISK":PLOT 6,2:GOTO 2280
2210 IF KK= 1THEN 1220
2220 IF KK= 2THEN 1390
2230 IF PEEK (D3+ 1)= 2THEN 2250
2240 SI= 1:RETURN
2250 SI= 2:RETURN
2260 PLOT 6,1:PRINT :PRINT "E R R O R!":PLOT 6,3:PRINT
2270 PRINT "DISK NUMBER IS OUT OF RANGE (1-64).":PLOT 6,2
2280 INPUT "TRY AGAIN / PRESS ENTER:";Q$:GOSUB 2300
2290 ON JJGOTO 1180,1200,1350,1370,1390,1220,1130,1750
2300 REM  ------------------------------------------------.
2310 REM  ERASE LINE ROUTINE.
2320 REM  ------------------------------------------------.
2330 FOR RO= 1TO EL:PLOT 28:NEXT RO
2340 FOR RO= 1TO EL
2350 PRINT "                                               "
2360 NEXT RO
2370 FOR RO= 1TO EL:PLOT 28:NEXT RO:PLOT 6,3:RETURN
2380 PLOT 6,1:PRINT :PRINT "E R R O R!":PLOT 6,3:PRINT
2390 PRINT "THERE ARE ONLY TWO(2) SIDES TO A DISK.":PLOT 6,2
2400 GOTO 2280
2410 PLOT 27,18,4,27,13:PRINT CHR$ (28)
2420 PRINT "-------------------------------------------------";
2425 PRINT "----------"
2430 PRINT "DIRECTORY FOR:   DISK";BB"    SIDE";SD
2440 POKE 33265,0:PLOT 27,18,4,27,7
2450 PRINT "DIR":PLOT 27,27:POKE 33265,0:GOTO 1720
2460 END