Compucolor.org – Virtual Media

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

100 REM  ACTIVITY COMPLETION DATE CALCULATION
110 REM  J.DE WAARD 03.07.1981
120 REM  1=SAT,2=SUN,3=MON,4=TUE,5=WED,6=THU,7=FRI.
150 FF= 0
155 Q= 0
160 PLOT 12
170 PLOT 3,0,7
180 PLOT 14
181 PLOT 29,21
200 PRINT TAB( 16);"DETERMINATION DATE OF COMPLETION"
201 PLOT 29,18
202 PLOT 15
400 PRINT :GOTO 500
450 PLOT 29,17:PRINT "DATE ERROR,RESTART CALCULATION"
452 PLOT 29,18:PRINT
500 INPUT "ENTER ACTIVITY START DATE (DD.MM.YYYY).....:";SD$
510 B= VAL (LEFT$ (SD$,2))
520 A= VAL (MID$ (SD$,4,2))
530 C= VAL (RIGHT$ (SD$,4))
600 FF= 1
700 GOSUB 5000
710 IF FF= 1THEN FS= F
720 PRINT
730 INPUT "ENTER ACTIVITY DURATION (# OF WORKING DAYS):";DP
740 REM
750 D= DP+ 2* INT (DP/ 5)
760 FB= FS+ D
761 PRINT
770 C= C+ INT (D/ 365)
780 A1= (D/ 365- INT (D/ 365))* 12
790 A= A+ INT (A1)
800 B= B+ INT ((A1- INT (A1))* 30.5)
810 IF B> 31THEN A= A+ 1:B= B- 31
820 IF A> 12THEN C= C+ 1:A= A- 12
1000 FF= 0
1100 GOSUB 5000
1200 IF FF= 0THEN FC= F
1220 PRINT
1400 D1= FS- (INT (FS/ 7)* 7)
1500 D2= FC- (INT (FC/ 7)* 7)
1600 C1= 6- D1
1700 DA= C1+ FS
1900 C2= 6- D2
2000 DE= C2+ FC
2200 ND= DE- DA
2300 WD= INT (ND/ 7)* 2
2400 W1= ND- WD
2500 IF D1> 1AND D2> 1THEN W= W1+ C1- C2
2600 IF D1> 1AND D2< 2THEN W= W1+ C1- 4
2700 IF D1< 2AND D2> 1THEN W= W1+ 4- C2
2800 IF D1< 2AND D2< 2THEN W= W1
4000 WD= W
4010 DW= WD- DP
4015 PRINT :PRINT
4020 IF ABS (DW)< 1AND D2> 1THEN 4130
4024 IF ABS (DW)< 1AND D2= 0THEN B= B+ 2
4028 IF ABS (DW)< 1AND D2= 1THEN B= B+ 1
4030 B= B- DW
4040 IF B< 1THEN A= A- 1:B= B+ 31
4045 IF A< 1THEN C= C- 1:A= A+ 12
4050 IF A= 2AND B> 29THEN A= A+ 1:B= B- 29
4060 IF B> 30AND A= 4OR B> 30AND A= 6OR B> 30AND A= 9OR B> 30AND A= 11THEN A= A+ 1:B= B- 30
4070 IF B> 31THEN A= A+ 1:B= B- 31
4100 IF A> 12THEN C= C+ 1:A= A- 12
4110 GOSUB 5000
4120 GOTO 1200
4130 PRINT "THE ACTIVITY END DATE IS...................:";
4132 A= A+ 100:B= B+ 100
4135 PRINT TAB( 44)RIGHT$ (STR$ (B),2)+ "."+ RIGHT$ (STR$ (A),2)+ "."+ RIGHT$ (STR$ (C),4)
4137 PRINT :IF  Q= 1 THEN  4155
4140 INPUT "ARE THERE ANY PUBLIC HOLIDAYS BETWEEN THESE DATES?   ";PH$
4145 PLOT 28,11
4150 IF LEFT$ (PH$,1)= "Y"THEN 4165
4155 PRINT :PRINT ""
4160 PRINT TAB( 19)"END DATE IS START DATE"
4162 PRINT  TAB( 21)"SUBSEQUENT ACTIVITY":PRINT ""
4163 PLOT 3,33,30,29,17
4164 INPUT "HIT ENTER TO CONTINUE";EN:GOTO 4170
4165 Q= 1:PRINT :PRINT ""
4166 PRINT TAB( 11)" ADD PUBLIC HOLIDAYS TO COMPLETION DATE "
4167 PRINT ""TAB( 9)"HIT ENTER,INPUT CALCULATED END-DATE AS START"
4168 PRINT TAB( 10)"DATE AND # OF PUBLIC HOLIDAYS AS DURATION!"
4169 INPUT "";EN:GOTO 160
4170 B= 0:GOSUB 9500
4171 PLOT 3,0,9:PRINT "":PRINT "ARE   :"
4172 PRINT "" TAB( 10)"A. OTHER COMPLETION DATES TO BE CALCULATED;"
4173 PRINT :PRINT TAB( 10)"B. OTHER PERT TASKS TO BE PERFORMED; OR IS"
4174 PRINT :PRINT TAB( 10)"C. PROGRAMME TO BE TERMINATED?"
4175 PRINT :PRINT "":INPUT "SELECT:   A, B, OR C  ";OT$
4180 IF  LEFT$ (OT$,1)= "A"THEN 150
4190 IF  LEFT$ (OT$,1)= "B"THEN 7100
4200 IF  LEFT$ (OT$,1)= "C"THEN 4210
4205 GOTO 9000
4210 GOSUB 9500
4230 PLOT 3,15,15
4240 PRINT "THANK YOU AND TOT ZIENS"
4250 PLOT 3,0,0
4260 INPUT "";EN:RUN
4270 PLOT 8:INPUT "";EN:RUN
5000 IF A> 12OR A< 1OR B< 1OR B> 31OR C< 1582GOTO 500
5100 IF A> 2GOTO 5300
5200 F= 365* C+ B+ 31* (A- 1)+ INT ((C- 1)/ 4)- INT (3/ 4* (INT (((C- 1)/ 100)+ 1)))
5250 GOTO 5400
5300 F= 365* C+ B+ 31* (A- 1)- INT (0.4* A+ 2.3)+ INT (C/ 4)- INT (3/ 4* (INT (C/ 100)+ 1))
5400 RETURN
7100 PLOT  12:PLOT  3,12,15,29,21
7110 INPUT "INSERT PROGRAMME DISK AND HIT RETURN";P$
7120 PLOT  29,18
7130 FILE "T",8000
7140 LOAD "MENU":RUN
8000 REM  FILE TRAP
8010 PLOT  12,3,5,15
8020 PRINT "SORRY WRONG DISK"
8030 PLOT  29,18,15:GOTO  7110
9000 GOSUB 9500
9040 GOTO 4171
9500 REM  ERASE PAGE
9510 FOR  Y= 31 TO  B STEP - 1
9520 PLOT 3,0,Y,11:NEXT Y
9530 RETURN