10 REM DISPLAY TEAM AND BOWLER RECORD SHEETS      (RECORDD)
12 REM Developed by William W. Klaproth,  Moraga Ca.  94556    September 1982
20 REM MASTER FILE DESCRIPTIONS FOR ALL BOWLING PROGRAMS
30 OPEN "B:TEAMS.HDR" AS #1 LEN = 64
40 FIELD #1, 2 AS TM$, 30 AS NAM$, 2 AS RCNT$, 2 AS GAM$, 4 AS PINS$, 2 AS AVG$, 2 AS HIG$, 2 AS HIS$, 4 AS PTSW$, 4 AS PTSL$, 2 AS B1ID$, 2 AS B2ID$, 2 AS B3ID$, 2 AS B4ID$, 2 AS B5ID$
50 FIELD #1, 2 AS HDRID$, 30 AS LEAGUE$, 2 AS WEEKS$, 2 AS TEAMS$, 4 AS FILLER$, 2 AS BWLPERTM$, 2 AS NXTID$, 2 AS HCPBASE$, 4 AS HCPPCNT$
60 OPEN "B:BOWLERS.HDR" AS #2 LEN = 64
70 FIELD #2, 2 AS BBO$, 30 AS BNAM$, 2 AS BRCNT$, 2 AS BGAM$, 4 AS BPINS$, 2 AS BAVG$, 2 AS BHIG$, 2 AS BHIS$, 2 AS BHCP$, 2 AS BHIGH$, 2 AS BHISH$, 2 AS BTM$,2 AS GAM2$, 2 AS SER5$, 2 AS SER6$,2 AS CURSER$,2 AS AVGLSTYR$
80 OPEN "B:TEAM.DET" AS #3 LEN = 16
90 FIELD #3,2 AS DTM$, 2 AS TMO$, 2 AS TDAY$, 2 AS TG1$, 2 AS TG2$, 2 AS TG3$, 2 AS TSER$, 2 AS DPTSW$
100 OPEN "B:BOWLER.DET" AS #4 LEN = 16
110 FIELD #4,2 AS DBO$, 2 AS BMO$, 2 AS BDAY$, 2 AS BG1$, 2 AS BG2$, 2 AS BG3$, 2 AS BSER$
120 REM OPEN "B:HISCORES.DET" AS #5 LEN = 16
130 REM FIELD #5, 2 AS HBNO$, 2 AS HG1$, 2 AS HG2$, 2 AS HG3$, 2 AS HSER$, 1 AS HFLG1$, 1 AS HFLG2$, 1 AS HFLG3$, 1 AS HFLGS$
140 CLS
150 PRINT "TEAM AND BOWLER RECORD SHEET DISPLAY PROGRAM"
160 PRINT " "
170 INPUT "ENTER DESIRED PRINT OPTION: T=TEAMS; B=BOWLERS; Q=QUIT :",OP$
180 IF OP$ = "T" OR OP$ = "t" GOTO 280
190 IF OP$ = "B" OR OP$ = "b" GOTO 230
200 IF OP$ = "Q" OR OP$ = "q" GOTO 330
210 PRINT "INVALID OPTION ENTERED"
220 GOTO 170
230 INPUT "ENTER DESIRED BOWLER NUMBER (999 TO QUIT):",B%
240 CLS
250 IF B% = 999 GOTO 170
260 GOSUB 370
270 GOTO 230
280 INPUT "ENTER DESIRED TEAM NUMBER (99 TO QUIT):",T%
290 CLS
300 IF T% = 99 GOTO 170
310 GOSUB 730
320 GOTO 280
330 PRINT "Returning to MENU"
340 CLOSE
350 RUN "A:MENU"
360 REM SUBROUTINE TO PRINT BOWLER RECORD SHEETS
370 PRINT "                    BOWLER RECORD SHEET            ";DATE$
380 PRINT " "
390 GET #2,B%
400 PRINT BNAM$;"     HIGAM  HISER  HHGAM  HHSER"
410 PRINT SPC(33);
420 PRINT USING "   ####";CVI(BHIG$),CVI(BHIS$),CVI(BHIGH$),CVI(BHISH$)
430 PRINT " "
440 PRINT "                          GRAND"
450 PRINT " DATE GAM1 GAM2 GAM3  TOT TOTAL GAM  AVG"
460 PRINT "----- ---- ---- ----  --- ----- ---  ---"
470 GAM% = 0:PINS = 0
480 FOR TREC% = 1 TO CVI(BRCNT$)
490 REM RANDOMIZING ROUTINE FOR BOWLER DETAIL ADDRESSES
500 X = B% / 2: X% = CINT(X): Y% = X% * 2
510 WREC% = TREC%
520 IF Y% = B% THEN WREC% = TREC% + 50
530 BDET% = X% * 100 + WREC% - 100
540 REM END OF RANDOMIZING ROUTINE
550 GET #4,BDET%
560 G% = 3   'CALCULATE NUMBER OF GAMES BOWLED
570 IF CVI(BG1$) = 0 THEN G% = G% -1
580 IF CVI(BG2$) = 0 THEN G% = G% -1
590 IF CVI(BG3$) = 0 THEN G% = G% -1
600 GAM% = GAM% + G%
610 PINS = PINS + CVI(BSER$)
620 AVG = PINS / GAM%
630 AVG% = INT(AVG)
640 PRINT USING "##";CVI(BMO$);
650 PRINT "-";
660 PRINT USING "## ";CVI(BDAY$);
670 PRINT USING "#### ";CVI(BG1$),CVI(BG2$),CVI(BG3$),CVI(BSER$);
680 PRINT USING "##### ";PINS;
690 PRINT USING "###  ";GAM%,AVG%
700 NEXT TREC%
710 RETURN
720 REM SUBROUTINE TO PRINT TEAM RECORD SHEETS
730 PRINT "                     TEAM RECORD SHEET             ";DATE$
740 PRINT " "
750 GET #1,T% + 1
760 PRINT NAM$;"HI GAME:";CVI(HIG$);"   HI SERIES:";CVI(HIS$)
770 PRINT " "
780 PRINT "                  SEASON                      GRAND"
790 PRINT " DATE  WON LOST  WON LOST GAM1 GAM2 GAM3  TOT TOTAL  GAM  AVG"
800 PRINT "-----  --- ----  --- ---- ---- ---- ----  --- -----  ---  ---"
810 GAM%=0: PINS=0: TGW=0: TGL=0
820 FOR TREC% = 1 TO CVI(RCNT$)
830 REM RANDOMIZING ROUTINE FOR TEAM DETAIL ADDRESSES
840 X = T% / 2: X% = CINT(X): Y% = X% * 2
850 TWREC% = TREC%
860 IF Y% = T% THEN TWREC% = TREC% + 50
870 TDET% = X% * 100 + TWREC% - 100
880 REM END OF RANDOMIZING ROUTINE
890 GET #3,TDET%
900 PRINT USING "##";CVI(TMO$);
910 PRINT "-";
920 PRINT USING "##";CVI(TDAY$);
930 GW=CVI(DPTSW$)/10: GL=4-GW: TGW=TGW+GW: TGL=TGL+GL
940 PRINT USING " ##.#";GW,GL,TGW,TGL;
950 PRINT USING " ####";CVI(TG1$),CVI(TG2$),CVI(TG3$),CVI(TSER$);
960 PINS=PINS+CVI(TSER$): GAM%=GAM%+3: AVG=PINS/GAM%: AVG%=INT(AVG)
970 PRINT USING " #####";PINS;
980 PRINT USING " ####";GAM%,AVG%
990 NEXT TREC%
1000 RETURN