* YEAR.CMD
* M. Lynn
* Version 1.6
ERASE
SET INDEX TO
SET INTENSITY OFF

LOCATE FOR $(date,7,2) # year

IF EOF
@ 5, 0 SAY 'All records in the '+maccount+' database are for 19'+year
@ 22, 0 SAY 'Enter any character to return to menu'
SET CONSOLE OFF
WAIT 
SET CONSOLE ON
RELEASE c, line, newyear
RETURN
ELSE
@ 5, 0 SAY 'The '+maccount+' database contains records from years other than 19'+year
@ 6, 0 SAY 'They are as follows: '

STORE 1 TO c
	DO WHILE c < 5
	STORE STR(c+10, 2) TO line
	STORE STR(VAL(year)-c, 2) TO newyear
	GO TOP
	LOCATE FOR $(date,7,2) = newyear
		IF EOF
		@ &line, 0 SAY 'no records for 19'+newyear
		ELSE
		@ &line, 0 SAY 'There are records in the database from 19'+newyear
		ENDIF
	STORE c + 1 TO c
	ENDDO # c

	LOCATE FOR VAL($(date,7,2)) < VAL(year)-4 .OR. VAL($(date,7,2)) > VAL(year)

	IF .NOT. EOF
	@ 16, 0 SAY 'These records may be incorrect -- please archive'
	@ 17, 0 SAY 'or delete them'
	? 'NUMBER -- DATE --   AMOUNT'
	? '--------------------------'
	LIST OFF number, date, amount FOR VAL($(date,7,2)) < VAL(year)-4;
	.OR. VAL($(date,7,2)) > VAL(year)			
	? 'ENTER ANY CHARACTER TO CONTINUE'
	SET CONSOLE OFF
	WAIT
	SET CONSOLE ON
	RELEASE c, line, newyear
	RETURN
	ELSE
	@ 22, 0 SAY 'ENTER ANY CHARACTER TO RETURN TO THE MENU'
	SET CONSOLE OFF
	WAIT
	SET CONSOLE ON
	ENDIF
	RELEASE c, line, newyear
	RETURN

ENDIF # EOF
RELEASE c, line, newyear
RETURN
SOLE OFF
	WAIT
	SET CONSOLE ON
	ENDIF
	RELEASE c, line, newyear
	RETURN

ENDIF 