100 REM - ROUTINE TO DO GANTT CHARTS
200 REM - DEVELOPED BY B. YANCEY  JUNE, 1982
300 REM - ROUTINE IS SETUP TO DRIVE AN EPSON MX80
400 REM - IN COMPRESSED MODE
500 REM - ROUTINE EXPECTS TO READ DATA FROM DISK FILE
600 REM - FORMAT -
700 REM - DATE$,TIME,RESP$,DESC$
800 REM - DATE$ IS STARTING DATE MMDDYY
900 REM - TIME IS TIME IN DAYS TO COMPLETE THE TASK
1000 REM - RESP$ IS CODE (1 CHAR) FOR PERSON RESPONSIBLE FOR TASK
1100 REM - DESC$ IS DESCRIPTION OF TASK 
1200 DIM MD(12),ML$(12),DAY$(7)
1300 PRINT " GANTT CHART ROUTINE"
1400 PRINT
1500 REM - INITIALIZE ARRAYS
1600 FOR I=1 TO 12
1700 READ MD(I)
1800 NEXT I
1900 FOR I=1 TO 12
2000 READ ML$(I)
2100 NEXT I
2200 FOR I=1 TO 7
2300 READ DAY$(I)
2400 NEXT I
2500 DATA 31,28,31,30,31,30,31,31,30,31,30,31
2600 DATA "JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"
2700 DATA " ","M","T","W","T","F"," "
2800 REM - INPUT VALUES
2900 INPUT "TITLE";BUF$
3000 ITB = 65 - LEN(BUF$)/2
3100 REM - SET COMPRESSED MODE AND SMALLER LINE SPACING
3200 LPRINT CHR$(27);"0"
3300 LPRINT CHR$(15)
3400 LPRINT CHR$(27) "C" CHR$(88)
3500 LPRINT TAB(ITB);BUF$
3600 LPRINT
3700 INPUT "STARTING DATE - MMDDYY";SDTE$
3800 SMM = VAL(LEFT$(SDTE$,2))
3900 SDD = VAL(MID$(SDTE$,3,2))
4000 SYY = VAL(RIGHT$(SDTE$,2))
4100 INPUT "ENDING DATE - MMDDYY";EDTE$
4200 EMM = VAL(LEFT$(EDTE$,2))
4300 EDD = VAL(MID$(EDTE$,3,2))
4400 EYY = VAL(RIGHT$(EDTE$,2))
4500 MM2=EMM: DD2=EDD: YY2=EYY
4600 REM - CALL SUB TO CALCULATE PERIOD IN DAYS
4700 GOSUB 10000
4800 PERIOD = TDAYS
4900 SCAL = 1
5000 IF PERIOD/SCAL > 100 THEN SCAL = SCAL*7
5100 IF PERIOD/SCAL > 100 THEN SCAL = SCAL*2
5200 PRINT " SCALE TO BE USED IS ";SCAL;" DAYS"
5300 PRINT " PERIOD IS ";PERIOD;" DAYS"
5400 PRINT
5500 INPUT "DAY OF WEEK FOR STARTING DATE - 1-SUN, 2-MON, ETC";SDAY
5600 LPRINT
5700 LPRINT TAB(22);"STARTING DATE: ";SDTE$;TAB(110);"ENDING DATE: ";EDTE$
5800 LPRINT TAB(22);"---------------------";TAB(110);"-------------------"
5900 GOSUB 12800
6000 INPUT "FILE FOR TASK DATA";FILE$
6100 OPEN "I",1,FILE$
6200 INPUT#1,DATE$,TIME,RESP$,DESC$
6300 EMM = VAL(LEFT$(DATE$,2))
6400 EDD = VAL(MID$(DATE$,3,2))
6500 EYY = VAL(RIGHT$(DATE$,2))
6600 IF EYY > YY2 THEN GOTO 6900
6700 GOSUB 10000
6800 GOTO 7100
6900 EYY = YY2: EDD=DD2: EMM=MM2
7000 GOTO 6700
7100 BUF$ = "|"
7200 STP=(PERIOD+(SCAL-1))/SCAL
7300 INDX=(TDAYS + (SCAL-1))/SCAL - 1
7400 IF INDX=0 THEN GOTO 7800
7500 FOR I=1 TO INDX
7600 BUF$ = BUF$ + " "
7700 NEXT I
7800 INDX = (TIME + (SCAL-1))/SCAL
7900 FOR I=1 TO INDX
8000 BUF$ = BUF$ + LEFT$(RESP$,1)
8100 NEXT I
8200 LPRINT LEFT$(DESC$,20);TAB(21);BUF$
8300 IF LEN(DESC$) > 20 THEN LPRINT MID$(DESC$,21,20)
8400 IF LEN(DESC$) > 40 THEN LPRINT MID$(DESC$,41,20)
8500 LPRINT DIV$
8600 IF EOF(1) THEN GOTO 8800
8700 GOTO 6200
8800 BUF$ = SPACE$(20)
8900 STP = (PERIOD+(SCAL-1))/SCAL
9000 FOR I=1 TO STP
9100 BUF$ = BUF$ + "-"
9200 NEXT I
9300 LPRINT BUF$
9400 LPRINT
9500 LPRINT " SCALE IS";SCAL;" DAYS"
9600 CLOSE
9700 LPRINT CHR$(24)
9800 LPRINT CHR$(18)
9900 END
10000 REM - SUBROUTINE TO DETERMINE PERIOD BETWEEN TWO DATES IN DAYS
10100 REM - VALUE RETURNED IN TDAYS
10200 REM - SMM SDD SYY - STRATING DATE
10300 REM - EMM EDD EYY - ENDING DATE
10400 TDAYS = 0
10500 IF EYY > SYY THEN GOTO 11500
10600 IF EMM > SMM THEN GOTO 11500
10700 TDAYS = EDD - SDD +1
10800 RETURN
10900 TDAYS = MD(SMM) -SDD + 1
11000 FOR I = (SMM+1) TO (EMM-1)
11100 TDAYS = TDAYS + MD(I)
11200 NEXT I
11300 TDAYS = TDAYS + EDD
11400 RETURN
11500 TDAYS = MD(SMM) - SDD + 1
11600 INDX = (EYY - SYY) + 1
11700 FOR J=1 TO INDX
11800 IF J=1 THEN STRT = SMM + 1
11900 STP = 12
12000 IF J>1 THEN STRT = 1
12100 IF J=INDX THEN STP=(EMM - 1)
12200 FOR I=STRT TO STP
12300 TDAYS = TDAYS + MD(I)
12400 NEXT I
12500 NEXT J
12600 TDAYS = TDAYS + EDD
12700 RETURN
12800 REM - ROUTINE TO DO HEADINGS
12900 IF SCAL > 1 THEN GOTO 16900
13000 DIV$ = SPACE$(21)
13100 BUF$=SPACE$(21)
13200 BUF2$=SPACE$(21)
13300 STRT = SMM
13400 IF SDD>1 THEN STRT=STRT + 1
13500 IF SDD = 1 THEN GOTO 14300
13600 FOR I=SDD TO MD(SMM)
13700 BUF$ = BUF$ + " "
13800 IF FIX(I/5)*5 <> I THEN GOTO 14100
13900 IF FIX(I/10)*10 = I THEN BUF2$ = BUF2$ + "0": GOTO 14200
14000 BUF2$ = BUF2$ + "5": GOTO 14200
14100 BUF2$ = BUF2$ + " "
14200 NEXT I
14300 FOR I=STRT TO EMM
14400 BUF$=BUF$ + ML$(I)
14500 BUF2$ = BUF2$ + "1  "
14600 FOR J=4 TO MD(I)
14700 BUF$=BUF$ + " "
14800 IF FIX(J/5)*5 = J THEN GOTO 15100
14900 BUF2$ = BUF2$ + " "
15000 GOTO 15300
15100 IF FIX(J/10)*10 = J THEN BUF2$ = BUF2$ + "0": GOTO 15300
15200 BUF2$ = BUF2$ + "5"
15300 NEXT J
15400 NEXT I
15500 LPRINT BUF$
15600 LPRINT BUF2$
15700 REM - DAY SCALE
15800 BUF$ = SPACE$(21)
15900 STRT = SDAY
16000 STP=(PERIOD + (SCAL-1))/SCAL
16100 FOR J=1 TO STP
16200 IF SCAL=1 THEN BUF$=BUF$ + DAY$(STRT)
16300 IF SCAL > 1 THEN BUF$ = BUF$ + DAY$(SDAY)
16400 IF SCAL = 1 AND STRT = 1 THEN DIV$ = DIV$ + "|" ELSE DIV$ = DIV$ + " "
16500 STRT = STRT + 1
16600 IF STRT > 7 THEN STRT = 1
16700 NEXT J
16800 LPRINT BUF$
16900 BUF$ = SPACE$(20)
17000 FOR J=1 TO STP
17100 BUF$ = BUF$ + "-"
17200 NEXT J
17300 LPRINT BUF$
17400 RETURN
T BUF$
16900 