Compucolor.org – Virtual Media

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

5 REM  FILES
7 REM  WRITTEN BY WALTER DEGLER  2/15/79
9 REM
10 REM  STATISTICS FILES ARE CREATED, DELETED, ALTERED, DISPLAYED OR MERGED
12 REM
25 PLOT 27,24,15,6,2,12
30 DIM D(174,5)
50 GOSUB 4000
75 ON ZGOSUB 2000,5000,6000,7000,11000,10000
100 IF Z= 7THEN LOAD "MENU":RUN
125 GOTO 50
1999 REM
2000 REM  INPUT NEW FILE DATA
2025 INPUT "FILE NAME AND NUMBER OF TYPES: ";F$,NT
2050 INPUT "NUMBER OF OBSERVATIONS: ";NO
2075 FILE "N",F$,NT,4* (NO+ 2),1
2100 GOSUB 9000
2125 GOTO 3000
2999 REM
3000 REM  OPEN FILE, OUTPUT DATA, CLOSE FILE
3025 FILE "R",1,F$,6
3050 FOR I= 0TO NT- 1
3075 PUT 1,I+ 1,1;NT,NO
3100 FOR J= 0TO NO- 1
3125 PUT 1,I+ 1,9+ 4* J;D(J,I)
3150 NEXT J,I
3175 FILE "C",1
3200 RETURN
3999 REM
4000 REM  SELECT ACTION
4025 PLOT 12,6,1,14
4050 PRINT "SELECT NUMBER OF DESIRED ACTION:"
4075 PRINT
4080 PLOT 6,3
4100 PRINT "1) CREATE FILE"
4125 PRINT "2) DELETE FILE"
4150 PRINT "3) ALTER OBSERVATIONS"
4175 PRINT "4) ADD AND/OR DELETE OBSERVATIONS"
4200 PRINT "5) DISPLAY FILE"
4225 PRINT "6) MERGE FILES"
4230 PRINT "7) END PROGRAM"
4250 PRINT :INPUT Z
4260 PLOT 12,6,2
4275 RETURN
4999 REM
5000 REM   DELETE A FILE
5010 PLOT 12,15
5025 PLOT 27,4:PRINT "DIR":PLOT 27,27
5030 PLOT 6,6
5050 PRINT "COMPLETE NAME OF FILE TO BE DELETED ":INPUT F$
5075 PLOT 27,4:PRINT "DEL "F$:PLOT 27,27
5100 FOR I= 0TO 1000:NEXT I
5110 PLOT 6,2
5125 RETURN
5999 REM
6000 REM   ALTER OBSERVATIONS IN A FILE
6025 GOSUB 8000
6050 GOSUB 9000
6075 FOR I= 0TO NT- 1
6100 FOR J= 0TO NO- 1
6125 PUT 1,I+ 1,9+ 4* J;D(J,I)
6150 NEXT J,I
6175 FILE "C",1
6200 RETURN
6999 REM
7000 REM  ADD OR DELETE OBSERVATIONS
7025 GOSUB 8000
7030 FILE "C",1
7050 PRINT "ENTER 'D' (DELETE) OR 'A' (ADD) & OBSERVATION NUMBER"
7200 PRINT :PRINT "ENTER 'F,0' WHEN DONE"
7225 PRINT :INPUT Z$,Z
7250 IF Z$= "F"THEN 7650
7275 IF Z$= "D"THEN 7550
7300 IF Z$< > "A"THEN 7225
7325 FOR I= NO- 1TO Z- 1STEP - 1
7350 FOR J= 0TO NT- 1
7375 D(I+ 1,J)= D(I,J)
7400 NEXT J,I
7425 FOR J= 0TO NT- 1
7450 PRINT SPC( 6+ 10* J);:PLOT 28
7475 INPUT "";D(Z- 1,J)
7500 NEXT
7510 NO= NO+ 1
7525 GOTO 7225
7550 FOR I= ZTO NO- 1
7575 FOR J= 0TO NT- 1
7600 D(I- 1,J)= D(I,J)
7625 NEXT J,I
7630 NO= NO- 1
7640 GOTO 7225
7650 FILE "N",F$,NT,4* (NO+ 2),1
7675 GOSUB 3000
7700 RETURN
7999 REM
8000 REM  INPUT OLD FILE DATA
8025 INPUT "FILE NAME: ";F$
8053 PLOT 6,1
8055 PRINT "THIS FILE WAS CREATED BY
8057 PLOT 6,3
8060 PRINT "1 - THE 'FILES' PROGRAM
8065 PRINT "2 - ONE OF THE OTHER STATISTICS PROGRAMS
8070 INPUT Z
8072 PLOT 15,6,2
8075 IF Z= 2THEN 13000
8077 FILE "R",1,F$,6
8080 GET 1,1,1;NT,NO
8100 FOR I= 0TO NT- 1
8125 FOR J= 0TO NO- 1
8150 GET 1,I+ 1,9+ 4* J;D(J+ DL,I)
8175 NEXT J,I
8225 RETURN
8999 REM
9000 REM  INPUT OBSERVATIONS
9010 PLOT 27,11,12,6,6,15
9025 PRINT :PRINT "ENTER '0' WHEN DONE"
9030 PRINT :PLOT 6,1
9050 PRINT "DATA:"
9060 PLOT 6,3
9075 INPUT "#";I
9100 IF I< 1THEN PLOT 27,24:RETURN
9125 FOR J= 0TO NT- 1
9150 PRINT SPC( 6+ 10* J);:PLOT 28
9175 INPUT "";D(I- 1,J)
9200 NEXT
9225 GOTO 9075
9999 REM
10000 REM  MERGE FILES
10010 PLOT 6,2
10025 INPUT "NEW FILE NAME: ";G$
10027 PLOT 6,1
10030 INPUT "ENTER 1-MERGE OBSERVATIONS OR 2-MERGE TYPES: ";Z
10032 PLOT 6,2
10035 IF Z= 2THEN 10500
10040 IF Z< > 1THEN 10030
10050 DL= 0
10075 INPUT "MERGE FILE NAME (OR '0' IF DONE): ";F$
10100 GOSUB 8077
10110 FILE "C",1
10125 MT= NT
10250 DL= DL+ NO
10275 INPUT "MERGE FILE NAME: ";F$
10300 IF F$= "0"THEN 10400
10325 GOSUB 8077
10340 FILE "C",1
10350 IF MT< > NTTHEN PLOT 6,1:PRINT "NO MATCH!":PLOT 6,2:GOTO 10275
10375 GOTO 10250
10400 FILE "N",G$,NT,4* (DL+ 2),1
10405 F$= G$
10410 NO= DL
10425 GOSUB 3000
10450 DL= 0
10475 RETURN
10500 K= 0
10525 INPUT "FILE NAME & # TYPES TO MERGE (OR '0,0' IF DONE): ";F$,N
10550 FOR I= 0TO N- 1:PRINT "TYPE"I+ 1" ";:INPUT T(I):NEXT
10575 GOSUB 12000
10600 MO= NO
10625 INPUT "MERGE FILE NAME & # TYPES TO MERGE: ";F$,N
10630 IF F$= "0"THEN 10725
10650 FOR I= 0TO N- 1:PRINT "TYPE"I+ 1" ";:INPUT T(I):NEXT
10675 GOSUB 12000
10680 IF NO< > MOTHEN PLOT 6,1:PRINT "MISMATCH!":PLOT 6,2:GOTO 10625
10700 GOTO 10625
10725 NT= K
10750 F$= G$
10775 FILE "N",G$,K,4* (NO+ 2),1
10800 GOSUB 3000
10825 K= 0
10850 RETURN
10999 REM
11000 REM  DISPLAY A FILE
11025 GOSUB 8000
11040 PLOT 15
11045 IF Z= 2THEN RETURN
11050 INPUT "BEGINNING OBSERVATION NUMBER (OR 0 TO END): ";Z
11060 IF Z= 0THEN FILE "C",1:RETURN
11075 IF NO< ZTHEN 11050
11100 K= Z+ 29:IF NO< KTHEN K= NO
11125 PLOT 12
11150 FOR I= ZTO K
11160 PLOT 6,1
11175 PRINT "#"I;
11180 PLOT 6,3
11200 FOR J= 0TO NT- 1
11225 PRINT TAB( 10* J+ 6);D(I- 1,J);
11250 NEXT
11275 PRINT ""
11300 NEXT
11325 PLOT 6,2
11350 PRINT
11375 GOTO 11050
11999 REM
12000 REM  INPUT FILE DATA FOR TYPE MERGE
12025 FILE "R",1,F$,4
12050 GET 1,1,1;NT,NO
12100 FOR I= 0TO N- 1
12125 IF T(I)> NTTHEN FILE "C",1:PLOT 6,1:PRINT "NONEXISTANT TYPE NUMBER!":PLOT 6,2:GOTO 10625
12150 FOR J= 0TO NO- 1
12175 GET 1,T(I),9+ 4* J;D(J,K)
12200 NEXT J
12225 K= K+ 1
12250 IF K> 6THEN FILE "C",1:PLOT 6,1:PRINT "TOO MANY TYPES!":PLOT 6,2:GOTO 10625
12275 NEXT I
12300 FILE "C",1
12325 RETURN
12999 REM
13000 REM  DISPLAY DSP FILE
13025 PLOT 27,4:PRINT "LOA "F$".DSP 6000":PLOT 27,27
13050 PLOT 3,0,31,11
13075 INPUT "";Z$
13100 RETURN