		REM    UPDATE CHECK BOOK MONTHLY\
		         BY CHRIS KOVACS  JULY 9, 1982

		REM	***VERSION 1.5***        OCTOBER 23, 1982
		REM 	ADDS FILE NAME CHANGE  "FILENAME.CHK"

		REM	UPDATE - LOADS ALL UNCLEARED CHECKS INTO
		REM	NEW FILE (NEXT MONTH'S) AND THEN CLEARS
		REM	ALL OF THE UNCLEARED CHECKS FROM THE OLD
		REM	FILE (THIS MONTH'S)


	PRINT CHR$(26)
	MT%=80
	DIM PY$(MT%), CN(MT%), DT(MT%), AM(MT%)
	GOTO 20
10	PRINT "FILE DOES NOT EXIST"
20	INPUT "ENTER OLD FILE NAME (THIS MONTH'S) --"; OF$
30	INPUT "ENTER BANK STATEMENT DATE (MM,DD) --"; MM%,DD%
		IF MM%<0 OR MM%>12 THEN 30
		IF DD%<0 OR DD%>31 THEN 30
	K=82
	SD=10000*K+100*MM%+DD%

		REM LOAD CONTENTS OF FILE
	IF END #1 THEN 10
	OPEN OF$+".CHK" AS 1
	FOR R% = 0 TO MT%
		READ #1; CN(R%), DT(R%), AM(R%), PY$(R%)
		IF CN(R%)<>0 THEN\
	NEXT
	CLOSE 1
	NA%=R% : A$=""

		REM DETERMINE INITIAL BALANCE BY ADDING CLEARED CHECKS
	FOR R%=0 TO NA%
		IF CN(R%)<0 THEN STB=STB+AM(R%)
	NEXT

	PRINT : PRINT
	INPUT "NEW FILE NAME (NEXT MONTH'S) --"; NF$

		REM SAVE UNCLEARED RECORD IN NEW FILE

	CREATE NF$+".CHK" AS 1
	FOR R% = 0 TO NA%-1
		IF CN(R%)<0 THEN 100
		PRINT ABS(CN(R%))
		PRINT #1; CN(R%), DT(R%), AM(R%), PY$(R%)
100	NEXT
	PRINT #1; 1,SD,STB,"INIT. BALANCE" : REM SAVE INIT BAL IN NEW FILE
	PRINT #1; 0,0,0,A$
	CLOSE 1

		REM SAVE CONTENTS OF OLD FILE WITHOUT UNCLEARED\
		    CHECKS

	OPEN OF$+".CHK" AS 1
	FOR R%=0 TO NA%-1
		IF CN(R%)>0 THEN 200
		PRINT ABS(CN(R%))
		PRINT #1; CN(R%), DT(R%), AM(R%), PY$(R%)
200	NEXT
	PRINT #1; 0,0,0,A$
	CLOSE 1
	
	REM       END OF PROGRAM.....
	CHAIN "CMENU"
	END
%)
200	NEXT
	PRINT #1; 0,0,0,A$
	CLOSE 1
	
	REM       END OF PROGRAM.....
	CHAIN "CMENU"
	END
