10 PRINT 
20 PRINT "PROGRAM TO CREATE ALL CONTROL FILES FOR MAGTAPE ARCHIVING."
30 PRINT "=========================================================="
40 PRINT 
50 PRINT "PLEASE INPUT 'NAMES' FILE NAME ";
60 LINPUT A$
70 IF LEN(A$)=0 THEN 50
80 OPEN A$ FOR INPUT AS FILE #1
90 A1$=""
100 PRINT "WHAT TYPE OF COPYING COMMAND FILES CORAL/MACRO REPLY C OR M";
110 INPUT A$
120 IF A$="C" THEN A1$=".COR"
130 IF A$="M" THEN A1$=".MAC"
140 IF LEN(A1$)=0 THEN 90
150 A$=SEG$(A1$,2,4)
160 B$="DEL"+A$+".CMD"
170 OPEN B$ FOR OUTPUT AS FILE #2
180 B$="SAVE"+A$+".CMD"
190 OPEN B$ FOR OUTPUT AS FILE #3
200 B$="GET"+A$+".CMD"
210 OPEN B$ FOR OUTPUT AS FILE #4
220 B$="PRINT"+A$+".CMD"
230 OPEN B$ FOR OUTPUT AS FILE #5
240 GOSUB 560
250 IF END #1 THEN 290
260 LINPUT #1:A$
270 GOSUB 840
280 GO TO 250
290 CLOSE #1
300 CLOSE #2
310 CLOSE #3
320 CLOSE #4
330 CLOSE #5
340 PRINT 
350 PRINT "DO YOU WISH TO RERUN THIS PROGRAM YES/NO";
360 INPUT A$
370 IF A$="YES" THEN 10
380 IF A$="Y" THEN 10
390 IF A$="NO" THEN 430
400 IF A$="N" THEN 430
410 PRINT "REPLY '";A$;"' NO UNDERSTOOD PLEASE REPLY 'YES' OR 'NO"
420 GO TO 350
430 REM CHAIN "[377,377]CONTROL.BAS"
440 STOP
450 REM OUTPUT DATA TO FILES
460 IF LEN(B2$)=0 THEN 480
470 PRINT #2:B2$ \ REM DELETE FILE
480 IF LEN(B3$)=0 THEN 500
490 PRINT #3:B3$ \ REM SAVE   FILE
500 IF LEN(B4$)=0 THEN 520
510 PRINT #4:B4$ \ REM GET    FILE
520 IF LEN(B5$)=0 THEN 540
530 PRINT #5:B5$ \ REM PRINT  FILE
540 REM
550 RETURN
560 REM COPY DEFAULT INFORMATION
570 B2$="ON ERROR CONTINUE"
580 B3$=B2$
590 B4$=B3$
600 B5$=""
610 GOSUB 450
620 B$=A1$ \ REM HOLD EXTENTION
630 IF A1$=".COR" THEN 760
640 A1$=".BIS"
650 A$="BUILDOLB"
660 GOSUB 840
670 A$="BUILDMLB"
680 GOSUB 840
690 A$="BUILDOLB"
700 A1$=".CMD"
710 GOSUB 840
720 A$="BUILDMLB"
730 GOSUB 840
740 A1$=B$ \ REM RESTORE EXTENTION
750 RETURN
760 REM CORAL HEADERS
770 A1$=".BIS"
780 A$="BLDCOROLB"
790 GOSUB 840
800 A1$=".CMD"
810 GOSUB 840
820 A1$=B$
830 RETURN
840 REM NORMAL PREFIXES AND SUBSCRIPTS
850 B2$="DELETE SY0:[270,317]"+A$+A1$+";*"
860 IF A1$=".TXT" THEN B2$=""
870 B3$="COPY SY0:[270,317]"+A$+A1$+" RS0:[200,25]*.*"
880 B4$="COPY RS0:[200,25]"+A$+A1$+" SY0:[270,317]*.*"
890 B5$=A$+A1$
900 IF A1$<>".COR" THEN B5$="-"+B5$
910 IF A1$=".TXT" THEN B5$=""
920 GOSUB 450
930 RETURN
940 END
