Compucolor.org – Virtual Media

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

5 REM  CALENDAR PROGRAM ORIGINATED BY COMPUCOLOR, MODIFIED BY EIKE MUELLER
10 CLEAR 1000:PLOT 6,2,12:PRINT TAB( 10):INPUT "INSERT DATA DISK (IF DESIRED) AND HIT RETURN ";ZZ$
15 PRINT :PRINT TAB( 10):INPUT  "WILL YOU BE USING A PRINTER? ";PR$
20 IF  LEFT$ (PR$,1)< > "Y"THEN  115
25 PRINT TAB( 10):INPUT  "PRINTER DIPS4: 2,3,4,6 AND S3: 1,3,4,5,6,7 ON? ";PD$
30 IF  LEFT$ (PD$,1)< > "Y" THEN  PLOT  28,11,7:GOTO  25
115 PLOT 27,18,4:REM  BAUDRATE ON 1200
120 PRINT TAB( 10):INPUT "
WHICH YEAR (IE., 79,80,81,...): ";Y$
130 FILE "T",1770
135 IF W= 1THEN 150
140 DIM S(200,2),M$(12),MD(12)
150 GOSUB 1370
160 DATA JAN,31,FEB,29,MAR,31,APR,30,MAY,31,JUN,30
170 DATA JUL,31,AUG,31,SEP,30,OCT,31,NOV,30,DEC,31
180 RESTORE 150:FOR I= 1TO 12:READ M$(I),MD(I):NEXT I
190 REM
200 REM
210 GOSUB 1240
220 PRINT TAB( 12);"SELECT ONE OF THE FOLLOWING OPTIONS:"
230 PRINT
240 PRINT TAB( 20);"A - ADD AN EVENT"
250 PRINT TAB( 20);"D - DELETE AN EVENT"
260 PRINT TAB( 20);"C - CLOSE FILES"
270 PRINT TAB( 20);"E - EXIT PROGRAM"
280 PRINT
290 PRINT TAB( 16);"1. LIST EVENTS FOR A DAY"
300 PRINT TAB( 16);"2. LIST EVENTS FOR A MONTH"
310 PRINT TAB( 16);"3. LIST ALL EVENTS"
320 PRINT :PRINT
330 PRINT TAB( 15):INPUT "ENTER SELECTION NUMBER: ";B$
332 IF B$= "A"OR B$= "D"OR B$= "C"OR B$= "E"THEN 340
333 IF LEFT$ (PR$,1)< > "Y"THEN 340
334 PRINT :PRINT TAB( 15):INPUT "OUTPUT TO THE SREEN OR PRINTER? ";CP$
340 IF B$= "A"THEN B= 1:GOTO 390
350 IF B$= "D"THEN B= 2:GOTO 390
360 IF B$= "C"THEN B= 6:GOTO 390
370 IF B$= "E"THEN B= 6:GOTO 390
380 B= 0:B1= VAL (B$):IF B1> 0AND B1< 4THEN B= B1+ 2
390 IF B< 1OR B> 7THEN 210
400 IF N> = 1OR B= 1THEN 420
410 PRINT TAB( 15)"NO EVENTS IN FILE":GOTO 330
420 ON BGOTO 440,620,980,820,1130,1470
430 REM
440 REM  ADD SPECIAL EVENTS
450 REM
460 GOSUB 1240
470 GOSUB 1600
480 GOSUB 1690
490 GOSUB 1730
500 N= N+ 1:PUT 1,N;T$[32]:TD= M* 100+ D
510 REM
520 REM
530 REM
540 IF N= 1THEN S(1,1)= TD:S(1,2)= 1:GOTO 210
550 IN= 0:FOR I= 1TO N- 1
560 IF TD< S(I,1)THEN IN= I:I= N- 1
570 NEXT I:IF IN= 0THEN S(N,1)= TD:S(N,2)= N:GOTO 210
580 FOR I= NTO IN+ 1STEP - 1
590 S(I,1)= S(I- 1,1):S(I,2)= S(I- 1,2):NEXT I
600 S(IN,1)= TD:S(IN,2)= N:GOTO 210
610 REM
620 REM  DELETE SPECIAL EVENTS
630 ME$= "Y"
635 CP$= "S"
640 GOSUB 1240
652 AZ= 1:CP$= "S"
654 GOTO 820
656 GOSUB 1240
660 GOTO 970:REM  LIST EVENTS FOR A DAY
665 REM
670 GOSUB 1950:REM  ENTER TITLE OF EVENT
680 T1$= LEFT$ (T$,5):DE= M* 100+ D:FG= 0
690 FOR I= 1TO N:IF DE< > S(I,1)THEN 770
700 GET 1,S(I,2);T$[32]
710 IF LEFT$ (T$,5)< > T1$THEN 770
720 FOR J= 1TO N:IF S(J,2)= NTHEN L= J:J= N
730 NEXT J:GET 1,S(L,2);T$[32]
740 S(L,2)= S(I,2):PUT 1,S(L,2);T$[32]
750 FG= 1:N= N- 1:IF N= I- 1THEN 770
760 FOR J= ITO N:S(J,1)= S(J+ 1,1):S(J,2)= S(J+ 1,2):NEXT J
770 NEXT I:PRINT
780 IF FG= 0THEN PRINT TAB( 10);"CANNOT LOCATE EVENT"
790 IF FG= 1THEN PRINT TAB( 10);"EVENT DELETED"
800 GOTO 940
810 REM
820 REM  LIST EVENTS FOR A GIVEN MONTH
830 IF LEFT$ (CP$,1)= "P"OR B$= "D"THEN 850
840 GOSUB 1240
850 PRINT :GOSUB 1600
855 IF LEFT$ (CP$,1)= "P"THEN PR= 1:GOTO 1800
860 PRINT
870 ZA= 0:ZZ= 0:FG= 0:FOR I= 1TO N
880 IF M< > INT (S(I,1)/ 100)THEN 920
890 ZZ= ZZ+ 1:FG= 1:D= S(I,1)- M* 100:GET 1,S(I,2);T$[32]
900 PRINT TAB( 7)"";M$(M);D" '"Y$;TAB( 20);"";T$;""
901 ZA= ZA+ 1
902 IF ZA= 4THEN ZA= 0:PRINT
905 IF LEFT$ (CP$,1)= "P"THEN 920
910 IF ZZ= 16THEN ZZ= 0:INPUT "

		    HIT RETURN TO CONTINUE....";I$:GOSUB 1240
920 NEXT I
930 IF FG= 0THEN PRINT TAB( 10)"NO EVENTS ENTERED FOR THIS MONTH"
935 IF LEFT$ (CP$,1)= "P"THEN 1900
940 PRINT :PRINT :PRINT TAB( 20)
950 INPUT "HIT RETURN TO CONTINUE....";I$
952 IF LEFT$ (ME$,1)= "Y"THEN 660
955 IF B$= "D"THEN PRINT TAB( 10):INPUT  "MORE EVENTS OF THIS MONTH TO BE DELETED? ";ME$
957 IF LEFT$ (ME$,1)= "Y"THEN ME$= "N":GOTO 660
960 GOTO 210
970 REM
980 REM  LIST EVENTS FOR A DAY
990 IF LEFT$ (CP$,1)= "P"OR B$= "D"THEN 1005
1000 GOSUB 1240
1005 IF LEFT$ (CP$,1)= "P"THEN PR= 2
1007 IF B$= "D"THEN 1020
1010 PRINT :GOSUB 1600
1020 GOSUB 1690
1022 IF B$= "D"THEN 1030
1024 IF LEFT$ (PR$,1)< > "Y"OR LEFT$ (CP$,1)= "S"THEN 1030
1025 GOTO 1800
1030 PRINT
1040 MD= M* 100+ D
1050 ZA= 0:FG= 0:FOR I= 1TO N
1060 IF MD< > S(I,1)THEN 1090
1070 FG= 1:GET 1,S(I,2);T$[32]
1080 PRINT TAB( 7)"";M$(M);D" '"Y$;TAB( 20);"";T$;""
1085 IF ZA= 4THEN ZA= 0:PRINT
1090 NEXT I
1100 IF FG= 0THEN PRINT TAB( 10);"NO EVENTS FOR THIS DATE"
1102 IF B$= "D"THEN 665
1105 IF LEFT$ (CP$,1)= "P"THEN 1900
1110 GOTO 940
1120 REM
1130 REM  LIST ALL EVENTS
1140 IF LEFT$ (CP$,1)= "P"THEN 1155
1150 GOSUB 1240
1155 IF LEFT$ (CP$,1)= "P"THEN PR= 3:GOTO 1800
1160 ZA= 0:ZZ= 0:FOR I= 1TO N
1170 M= INT (S(I,1)/ 100):D= S(I,1)- M* 100
1180 ZZ= ZZ+ 1:GET 1,S(I,2);T$[32]
1190 PRINT TAB( 7)"";M$(M);D" '"Y$;TAB( 20);"";T$;""
1191 ZA= ZA+ 1
1192 IF ZA= 4THEN ZA= 0:PRINT
1195 IF LEFT$ (CP$,1)= "P"THEN 1210
1200 IF ZZ= 16THEN ZZ= 0:INPUT "

		    HIT RETURN TO CONTINUE....";I$:GOSUB 1240
1210 NEXT I
1215 IF LEFT$ (CP$,1)= "P"THEN 1900
1220 GOTO 940
1230 REM
1240 REM
1250 REM
1260 PLOT 6,0
1270 PLOT 12
1280 PLOT 6,39
1290 PLOT 14
1300 PLOT 3,15,0
1310 PRINT " S P E C I A L    E V E N T S "
1320 PLOT 6,6
1330 PLOT 15
1340 PLOT 3,0,5
1350 RETURN
1360 REM
1370 REM
1380 REM
1390 FILE "R",1,"EVEN"+ Y$,1
1400 FILE "R",2,"DATE"+ Y$,1
1410 GET 2,1;N
1420 FOR I= 2TO N+ 1
1430 GET 2,I;S(I- 1,1),S(I- 1,2)
1440 NEXT I
1450 RETURN
1460 REM
1470 REM
1480 REM
1490 PUT 2,1;N
1500 FOR I= 2TO N+ 1:PUT 2,I;S(I- 1,1),S(I- 1,2):NEXT I
1510 FILE "C",1,2:IF B$= "C"THEN W= 1:GOTO 120
1520 PLOT 12,3,15,15:PRINT "A U F   W I E D E R S E H E N"
1525 PLOT 3,1,1:INPUT "";EN
1528 RUN
1530 REM
1540 REM
1550 PRINT "CANNOT LOCATE FILES FOR '"Y$;:INPUT ": DO YOU WANT TO CREATE ONE? ";ZZ$:IF LEFT$ (ZZ$,1)< > "Y"THEN 1520
1560 FILE "N","EVEN"+ Y$,200,32,8:FILE "N","DATE"+ Y$,200,8,16
1570 FILE "R",1,"DATE"+ Y$,1
1580 PUT 1,1;0,0:FILE "C",1:GOTO 150
1590 REM
1600 REM
1610 PRINT TAB( 10)
1620 INPUT "ENTER MONTH OF EVENT (3 LETTERS): ";M$
1630 M= 0:FOR I= 1TO 12:IF M$= M$(I)THEN M= I:I= 12
1640 NEXT I:IF M< > 0THEN PLOT 11:RETURN
1650 PRINT TAB( 10)"MONTH NOT RECOGNIZED"
1660 PLOT 28,28,11:GOTO 1610
1670 REM
1680 REM
1690 PRINT TAB( 10):INPUT "ENTER DAY OF MONTH: ";D
1695 IF D< 0THEN PRINT TAB( 10)"NO MORE DELETIONS":RETURN
1700 IF D> = 1AND D< = MD(M)THEN PLOT 11:RETURN
1710 PRINT TAB( 10)"ILLEGAL DATE":PLOT 28,28,11:GOTO 1690
1720 REM
1730 PRINT TAB( 32):PLOT 6,38:PRINT "                                "
1735 PLOT 6,2,28,28
1740 PRINT TAB( 10)"ENTER TITLE OF EVENT: ";
1745 PLOT 6,38:INPUT "";T$
1748 PLOT 6,2
1750 T$= T$+ "                                "
1760 RETURN
1770 FILE "E",FL,ER,LN:IF ER= 14THEN 1550
1780 PRINT "ERROR!":FOR X= 1TO 2000:NEXT :END :GOTO 170
1800 REM  GET HARDCOPY PRINTOUT
1810 PLOT 27,13
1820 PLOT  17:REM  SELECT PRINTER
1830 PLOT  30,1:REM  SET PRT TO 12 CHAR/IN & ENHCD.
1840 IF  PR= 1 THEN  PRINT "SPECIAL EVENTS OF "+ M$+ ". 19"+ Y$
1850 IF  PR= 2 THEN  PRINT "SPECIAL EVENTS OF "+ M$+ ".";D,;" 19"+ Y$
1860 IF  PR= 3 THEN PRINT "SPECIAL DATES/EVENTS OF 19"+ Y$
1870 PLOT  29,2:REM  SET TO 10 CHAR/IN
1880 PRINT :PRINT :PRINT "______________________________________________________________":PRINT :PRINT
1890 ON PRGOTO 860,1030,1160
1900 PRINT :REM  END OF PRINTOUT
1910 PRINT "______________________________________________________________":PRINT :PRINT :PRINT :PRINT :PRINT
1920 PLOT  19:REM  DESELECT PRINTER
1930 POKE  33265,0:REM  BACK TO THE CRT
1935 FILE "C",1,2
1940 W= 1:GOTO 120
1950 PRINT TAB( 32):PLOT 6,15:PRINT "     "
1960 PLOT 6,3,28
1970 PRINT TAB( 10)"ENTER TITLE OF EVENT: ";
1980 PLOT 6,15:INPUT "";T$
1985 ME$= "N"
1990 PLOT 6,2:RETURN