10	! YEARPROG.BAS
	! PROGRAM TO ACCUMULATE A 3 DIMENSIONAL ARRAY OF PROGRAMMER TIME
	! BY PROJECT, MONTH OF YEAR, AND PROGRAMMER.  ARRAY ELEMENTS ARE
	! INTEGERS CONTAINING TIME IN UNITS OF HUNDREDTHS OF AN HOUR.
	!
	! SIZE OF ARRAY: (60+1)PROJECTS * (13+1)MONTHS * (10+1)PROGRAMMERS=9394
	!
	! FY&=FISCAL YEAR OF INTEREST
	!
100 DIM R$[60]V
200 DIM #16,PR%(9394)
600	 ! ASK USER FOR FISCAL YEAR OF STATEMENT
610 INPUT "FISCAL YEAR (YY) "; YY
630 FY&=YY	! FISCAL YEAR
650 D1=DCEN("07/01/"+STR$(FY&-1))	! FIRST DAY OF FISCAL YEAR
	D2=DCEN("06/30/"+STR$(FY&))	! LAST  DAY OF FISCAL YEAR
1100 NP=6
1200 OVERLAY "PROJNUM/RT" 
1205 OPEN #16,"YEAR"+STR$(FY&)+".VPG/WR/BL" : GOSUB 1400
1208 F$="LOGTEMP.F"+STR$(FY&)
1210 OPEN #3,F$+"/RO/FX/LN:60/EN:1500"
1220 DEF FNSU(PJ,MO,PG)=(PJ*13+MO)*11+PG
1250 INPUT LINE #3,R$
	! GET PROJECT SUBSCRIPT
1270 DP$=TRM$(SBS$(R$,1,4)) : GOSUB 8000
1280 IF DP% < 1 OR DP% > 60 THEN PRINT R$ : PRINT "DP%=";DP% : GOTO 1330
	! GET MONTH SUBSCRIPT
1290 MO%=VAL(SBS$(R$,48,2)) : IF MO%<1 OR MO%>12 THEN
	PRINT R$ : PRINT "MO%=";MO% : GOTO 1330
	! GET PROGRAMMER SUBSCRIPT
1300 PG%=VAL(SBS$(R$,47,1)) : IF PG%<2 OR PG%>NP THEN
	PRINT R$ : PRINT "PG%=";PG% : GOTO 1330
	! GET HUNDREDTHS OF HOURS
1310 HR%=INT(VAL(SBS$(R$,54,5))*100+.5)
1320 PR%(FNSU(DP%,MO%,PG%))=HR%+PR%(FNSU(DP%,MO%,PG%))
1330 GOTO 1250
1400 DIM #16,PR(4697)
1405 FOR II= 4697 TO 0 STEP -1
1410 PR(II)=0 : NEXT II
1420 RETURN
1500 CLOSE : EXIT
