	REM * CHICAGO TIRE & SUPPLY CO.
	REM * TIRE RECORD PROGRAM
	REM * 	THIS PROGRAM ALLOWS ENTRY OF THE TIRES AND INVOICE
	REM *	NUMBER, PRICE, AND DATE AS EACH IS RECEIVED.  THE
	REM * 	PROGRAM FILES THIS IN THE TIRE.DAT FILE AND THEN
	REM *	THROUGH SUPERSORT, PUTS THIS INTO TIRE # ORDER FOR
	REM *	LATER PRINTING.


	C$(1)=CHR$(126)+CHR$(28)
	C$(2)=CHR$(126)+CHR$(17)
	C$(3)=CHR$(126)+CHR$(15)


	DEF FNA(X,Y)
	PRINT C$(2);CHR$(X);CHR$(Y);
	RETURN
	FEND

	DEF FNB(X$,X,Y)
	Z=FNA(X,Y)
	PRINT X$
	RETURN
	FEND

	DEF FNC(X$,X,Y,C)
	Z=FNA(X,Y)
	PRINT X$;
	IF C=1 THEN PRINT
	RETURN
	FEND


	PRINT C$(1)
8	Z=FNC("TIRE ENTRY AND DISPLAY PROGRAM",25,1,1)
	Z=FNC("ENTER MONTH NAME (JAN, FEB, ETC.) :",0,21,0)
10	Z=FNA(0,21)
	PRINT C$(3);
	INPUT "";LINE A$
	IF LEN(A$)=0 THEN 10
	IF LEN(A$)<>3 THEN 10
20	RESTORE
	FOR I=1 TO 12
	READ B$
	IF A$=B$ THEN 30
	NEXT I
	Z=FNC("INVALID MONTH ENTERED. RESUBMIT.",0,20,1)
	GOTO 10
30	Z=FNA(0,20)
	PRINT C$(3)
	IF END #1 THEN 100
	OPEN A$ RECL 60 AS 1
	READ #1,1;N
40	Z=FNB("TIRE NUMBER    :"+C$(3),0,5)
	Z=FNB("INVOICE #      :"+C$(3),0,6)
	Z=FNB("DATE           :"+C$(3),0,7)
	Z=FNB("PRICE PER      :"+C$(3),0,8)

50	Z=FNA(17,5)
	PRINT C$(3);
	INPUT "";LINE T$
	IF LEN(T$)=0 THEN 50
	IF LEN(T$)>25 THEN 50
60	Z=FNA(17,6)
	PRINT C$(3);
	INPUT "";LINE I$
	IF LEN(I$)>10 THEN 60

70	Z=FNA(17,7)
	PRINT C$(3);
	INPUT "";LINE D$
	IF LEN(D$)<>0 THEN Z$=D$
	D$=Z$
	Z=FNB(D$,17,7)

80	Z=FNA(17,8)
	PRINT C$(3);
	INPUT "";LINE P$
	IF LEN(P$)>10 THEN 80

90	Z=FNC("ANY CHANGE ? ",0,21,0)
	INPUT "";LINE A$
	IF LEN(A$)=0 THEN 90
	IF A$="Y" THEN 40
	IF A$="N" THEN 95
	GOTO 90

95	Z=FNB("FILING....",0,21)
	N=N+1
	PRINT #1,N;T$,I$,D$,P$
	PRINT #1,1;N

97	Z=FNC("ANOTHER ? ",0,21,0)
	INPUT "";LINE A$
	IF LEN(A$)=0 THEN 97
	IF A$="Y" THEN 40
	IF A$="N" THEN 98
	GOTO 97

98	Z=FNB("PROGRAM ENDED.",0,21)
	CLOSE 1
	STOP

100	Z=FNB("THERE IS NO FILE FOR THE MONTH OF "+A$,0,21)
	Z=FNC("SHALL I CREATE ONE (Y/N) ? "+C$(3),0,22,0)
	INPUT "";LINE R$
	IF LEN(R$)=0 THEN 100
	IF R$="Y" THEN 102
	IF R$="N" THEN 8
	GOTO 100

102	Z=FNA(0,21)
	PRINT C$(3)
	Z=FNA(0,220
	PRINT C$(3)
	Z=FNB("BUILDING FILE NOW...",0,21)
	CREATE A$ RECL 60 AS 1
	PRINT #1,1;1
	N=1
	GOTO 40

