Compucolor.org – Virtual Media

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

100 REM  #WORKING DAYS CALCULATION
110 REM  J.DE WAARD 10.03.1981
150 FF= 0
160 PLOT  12
170 PLOT  3,0,7
180 PLOT 14
181 PLOT 29,21
200 PRINT TAB( 16);"DETERMINATION # WORKING DAYS"
201 PLOT 29,18
202 PLOT 15
400 PRINT
500 INPUT "ENTER START DATE (DD.MM.YYYY)............:";SD$
510 GOSUB  5500
600 FF= 1:REM  RESULT SBR SELECTION
700 GOSUB 5000
800 IF FF= 1THEN  FS= F
850 PRINT :PRINT
900 INPUT "ENTER COMPLETION DATE (DD.MM.YYYY).......:";SD$
910 GOSUB  5500
1000 FF= 0
1100 GOSUB 5000
1200 IF FF= 0THEN  FC= F
1220 PRINT :PRINT
1250 NU= FC- FS:REM  # DAYS BETWEEN DATES
1275 IF NU= 0GOTO 500
1300 PRINT "# DAYS BETWEEN COMPLETION & START DATE...:";
1310 PRINT  RIGHT$ ("     "+ STR$ (NU),5);
1390 PRINT " DAYS":PRINT
1400 D1= FS- (INT (FS/ 7)* 7)
1500 D2= FC- (INT (FC/ 7)* 7)
1600 C1= 6- D1:REM  DATE NORMALISATION TO FRIDAY
1700 DA= C1+ FS:REM  DA=NORM. START DATE
1900 C2= 6- D2:REM  DATE NORMALISATION TO FRIDAY
2000 DE= C2+ FC:REM  DE=NORM.COMPL.DATE
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 PRINT :PRINT "# WORKING DAYS BETWEEN COMPL.& START DATE:";
4010 PRINT  RIGHT$ ("     "+ STR$ (W),5);
4020 PRINT " DAYS"
4100 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
5500 B= VAL (LEFT$ (SD$,2))
5510 A= VAL (MID$ (SD$,4,2))
5520 C= VAL (RIGHT$ (SD$,4))
5530 RETURN