     rem This is the Date Entry Program

%INCLUDE ALL.BAS
     RESTORE
	DIM T%(20),A(16),D$(8),N(2,2),DATE1$(8)
500 BIZMII.FLAG=0
505 z5$="b:date"
506 z6$="b:dateback"
515 repeat$="------------------------------"
516 fill$="                              "
520 dim z$(5,5),n(2,20),k$(6,20)
540 K$(6,1)="1 - ENTER DATES":K$(6,2)="2 - EXAMINE DATES"
550 K$(6,3)="3 - MODIFY DATES"
570 K$(6,4)="4 - CREATE NEW FILE":K$(6,5)="5 - CLEAR EXISTING FILE"
590 K$(6,6)="6 - FINISHED"
     print clear$:print
1075 K$(1,1)="CURRENT DATE":K$(1,2)="PERIOD ENDING DATE"
1080 K$(1,3)="PREVIOUS PERIOD ENDING DATE"
1085 K$(1,4)="MONTH ENDING DATE"
1090 K$(1,5)="QUARTER ENDING DATE"
1095 K$(1,6)="YEAR ENDING DATE"
1100 K$(1,7)="RESERVED"
1105 K$(1,8)="FISCAL YEAR ENDING DATE"
1110 K$(2,1)="1 - CURRENT DATE":K$(2,2)="2 - PERIOD ENDING DATE"
1115 K$(2,3)="3 - PREV PERIOD ENDING DATE"
1120 K$(2,4)="4 - MONTH ENDING DATE"
1125 K$(2,5)="5 - QUARTER ENDING DATE"
1130 K$(2,6)="6 - YEAR ENDING DATE"
1135 K$(2,7)="7 - RESERVED"
1140 K$(2,8)="8 - FISCAL YEAR ENDING DATE"
1145 K$(2,9)="9 - NONE"
1150 N(1,1)=8:N(1,2)=8:N(1,3)=8:N(1,4)=8:N(1,5)=8:N(1,6)=8
1155 N(1,7)=8:N(1,8)=8
     if end #1 then 6000
     open z5$ as 1
     close 1
1180 Z1=1:Z2=1
1600 PRINT clear$
1605 PRINT
1650 PRINT "THIS IS A LIST OF OPERATIONS."
1655 PRINT
1660 FOR Z=1 TO 6:PRINT K$(6,Z):NEXT Z:PRINT
1665 PRINT "INDICATE WHAT YOU WOULD LIKE TO DO BY TYPING"
1670 PRINT "THE CORRESPONDING NUMBER."
1675 PRINT
1680 INPUT Z
	IF Z<1 OR Z>6 then 1600
1685 ON Z GOSUB 2000,3000,4000,6000,7000,10000
1690 FOR Z=1 TO 20:N(2,Z)=0:NEXT Z:N$=""
1700 FOR Z=1 TO 20:K$(3,Z)="":NEXT Z
1705 GOTO 1600
2000 PRINT clear$:PRINT
2010 PRINT "ENTER DATES IN THE FORMAT MM-DD-YY. FACILITIES"
2015 PRINT "ARE PROVIDED FOR EXAMINING DATES FOR CORRECTNESS"
2020 PRINT "BEFORE THEY ARE STORED ON THE DISK"
2025 PRINT
2040 FOR Z=1 TO 8
	PRINT CUR$
2045 PRINT TAB(30);left$(repeat$,n(1,z))
	PRINT UP$;
2050 PRINT K$(1,Z);TAB(30);
2055 input line K$(3,Z):PRINT chr$(13)
2065 I=(N(1,Z)-LEN(K$(3,Z))):K$(3,Z)=K$(3,Z)+left$(fill$,I)
	PRINT CLEAR$
2085 NEXT Z
2090 N$=""
2095 FOR Z=1 TO 8
	N$=N$+K$(3,Z)
	D$(Z)=K$(3,Z)
	DATE1$(Z)=D$(Z)
     NEXT Z
2105 PRINT clear$:PRINT
2115 FOR Z=1 TO 9
2120 PRINT K$(2,Z);TAB(30);K$(3,Z)
2125 NEXT Z
2145 PRINT
2150 PRINT "IF AN ITEM IS TO BE CHANGED, TYPE THE APPROPRIATE NUMBER."
2155 PRINT:INPUT Z
2160 PRINT
2165 IF Z>8 THEN 2216
2170 IF Z<1 THEN 2105
2180 PRINT TAB(30);left$(repeat$,n(1,z))
	PRINT UP$;
2185 PRINT K$(1,Z);TAB(30);
2190 INPUT K$(3,Z)
2200 I=(N(1,Z)-LEN(K$(3,Z))):K$(3,Z)=K$(3,Z)+left$(fill$,I)
2216 N$=""
2220 FOR Z=1 TO 8
	N$=N$+K$(3,Z)
	D$(Z)=K$(3,Z)
	DATE1$(Z)=D$(Z)
     NEXT Z
2225 INPUT "ANY MORE CHANGES";line temp$
     if left$(temp$,1)="y" or left$(temp$,1)="Y" then 2105
2235 PRINT
2240 INPUT "IS RECORD TO BE ENTERED";line temp$
2245 PRINT
     if left$(temp$,1)="y" or left$(temp$,1)="Y" then 2280
     if left$(temp$,1)<>"n" and left$(temp$,1)<>"N" then 2235
2260 PRINT clear$:PRINT
2270 PRINT "*** RECORD NOT ENTERED ***":PRINT:PRINT
2275 FOR Z=1 TO 200:NEXT Z:RETURN
2276 Z1=1
2280 open z5$ as 1
     print #1; n$
     close 1
2300 RETURN
3000 PRINT clear$:PRINT
3005 Z1=1
3015 open z5$ as 1
     read #1; n$
     close 1
3030 PRINT
	PRINT "Should this be a 'hard-copy' listing (Y or N)?"
	INPUT LINE LIST$
	IF LIST$="y" OR LIST$="Y" THEN LPRINTER
3032 Z9=1
3035 FOR Z=1 TO 8
3040 PRINT K$(1,Z);TAB(30);MID$(N$,Z9,N(1,Z))
3045 Z9=Z9+N(1,Z)
3065 NEXT Z
	PRINT CHR$(13):PRINT CHR$(12)
	CONSOLE
3070 PRINT
3080 PRINT "IF FINISHED, TYPE RETURN.":PRINT
3085 input line temp$
3095 RETURN
4000 PRINT clear$:PRINT
4005 N$=""
4010 Z1=1
4030 open z5$ as 1
     read #1; n$
     close 1
4045 Z9=1
4050 FOR Z=1 TO 8
4055 K$(3,Z)=MID$(N$,Z9,N(1,Z))
4060 Z9=Z9+N(1,Z)
4065 NEXT Z
4070 GOTO 2105
6000 PRINT clear$:PRINT
6005 PRINT "IF YOU HAVE ARRIVED HERE, AND HAVE A DATE FILE"
6010 PRINT "ALREADY ON A DISK, YOU SHOULD INSTALL THAT DISK THEN"
6015 PRINT "TYPE THE letter c FOLLOWED BY A RETURN TO CONTINUE."
6020 PRINT
6025 PRINT "IF YOU WISH TO CREATE A NEW FILE, TYPE THE letter n"
6030 PRINT "FOLLOWED BY RETURN.":PRINT
6035 input line temp$
6040 IF left$(temp$,1)="c" or left$(temp$,1)="C" THEN INITIALIZE:GOTO 1600
6045 PRINT clear$:PRINT
6050 n$="":for z=1 to 80:n$=n$+" ":next z
6055 Z1=1
6065 create z5$ as 1
     print #1; n$
     close 1
6095 PRINT clear$:PRINT
6100 PRINT "DATE FILE CREATED AND CLEARED.":PRINT
6110 input "TO CONTINUE, TYPE RETURN.";line temp$
6115 GOTO 1600
7000 INPUT "ARE YOU SURE !!! (YES OR NO)";line temp$
7007 IF temp$<>"YES" THEN RETURN
7010 n$="":for z=1 to 80:n$=n$+" ":next z
7012 open z5$ as 1
     print #1; n$
     close 1
7035 PRINT clear$:PRINT
7040 PRINT "DATE FILE CLEARED!":PRINT
7045 input "TO CONTINUE, TYPE RETURN.";line temp$
7060 RETURN
10000 CHAIN "MASTER7"
