*********************************************************************
*                                                                   *
*                   DBASEII CHECKBOOK SYSTEM                        *
*                         Michael Lynn                              *
*                   221 S. Washington Street                        *
*                     Ypsilanti, Mi. 48197                          *  
*                        (313)-484-4297                             *
*                                                                   *
* This program may be used and modified freely.  This notice        *
* must be retained, and use of this program for profit, other than  *
* by its author is forbidden.                                       *
*                                                                   *
*********************************************************************       
* MENU.CMD                                                          *     
* M. Lynn                                                           *
* Version 1.6                                                       *
*********************************************************************
SET TALK OFF
SET ESCAPE OFF
SET INTENSITY OFF
SET DEFAULT TO B
RESTORE FROM B:INFO

DO B:SIGN

ERASE
STORE T TO go
DO WHILE go 
STORE '        ' to mdate
@ 13, 19 SAY 'ENTER DATE' GET mdate PICTURE '99/99/99'
READ
	IF VAL($(mdate,7,2))<80;
	.OR. VAL($(mdate,1,2))<1 .OR. VAL($(mdate,1,2))>12;
	.OR. VAL($(mdate,4,2))<1 .OR. VAL($(mdate,4,2))>31;
	.OR. (VAL($(mdate,1,2))=2 .AND. VAL($(mdate,4,2))>29)
	@ 15,19 SAY 'INCORRECT DATE - PLEASE TRY AGAIN'
	STORE 0 TO X
		DO WHILE X < 55
		STORE X+1 TO X
		ENDDO
	@ 15, 0
	@ 13, 0
	LOOP
	ELSE
	SET DATE TO &mdate
	RELE mdate
	STORE F TO go
	ENDIF
ENDDO
STORE $(date(),7,2) TO year

ERASE
@ 10, 10 SAY 'SELECT CHECK BOOK'     
@ 12, 10 SAY '1  - Personal Account'
@ 14, 10 SAY '2  - Business Account'
SET CONSOLE OFF
WAIT TO file
SET CONSOLE ON

IF file = '1'
USE PERSONAL
STORE 'PERSONAL' TO maccount
STORE perbal TO curbal
STORE per:no TO ac:no
ELSE
USE BUSINESS
STORE 'BUSINESS' TO maccount
STORE busbal TO curbal
STORE bus:no TO ac:no
ENDIF

DO WHILE t
ERASE
SET INTENSITY OFF
@ 4, 30 SAY 'CHECK BOOK MENU'
@ 5, 30 SAY '===== ==== ===='
@ 8, 10 SAY '0 - EXIT TO DBASE'
@ 9, 10 SAY '1 - ENTER NEW CHECKS'
@ 10, 10 SAY '2 - ENTER DEPOSIT, INTEREST PAYMENT OR SERVICE CHARGE'
@ 11, 10 SAY '3 - CANCEL CHECKS'
@ 12, 10 SAY '4 - VERIFY DEPOSITS'
@ 13, 10 SAY '5 - REPORTS MENU'
@ 14, 10 SAY '6 - BALANCE'
@ 15, 10 SAY '7 - SWITCH TO OTHER CHECKBOOK OR CHANGE SYSTEM DATE'
@ 16, 10 SAY '8 - HELP AND BANK INFORMATION'
@ 17, 10 SAY '9 - ARCHIVE MENU'
@ 18, 10 SAY 'x - EXIT TO CPM'
@ 20, 0
SET CONSOLE OFF
WAIT TO go
SET CONSOLE ON
SET INTENSITY ON

DO CASE

	CASE go='0'
	@ 8, 8 SAY '*'
	@ 20, 0
	RELEASE which, recnum, maccount, next, drive, dbf, ;
	maxdrive, year, fyear, ac:no, go
	IF file = '1' 
	STORE curbal TO perbal 
	ELSE 
	STORE curbal TO busbal
	ENDIF 
	RELEASE curbal, file
	SAVE TO INFO
	SET TALK ON
	SET ESCAPE ON
	CANCEL

	CASE go='1'
	@ 9, 8 SAY '*'
	@ 20, 0
	DO ENTER

	CASE go='2'
	@ 10, 8 SAY '*'
	@ 20, 0
	DO DEPOSIT

	CASE go='3'
	@ 11, 8 SAY '*'
	@ 20, 0
	DO CANCEL

	CASE go='4'
	@ 12, 8 SAY '*'
	@ 20, 0
	DO DCANCEL

	CASE go='5'
	@ 13, 8 SAY '*'
	@ 20, 0
	DO REPORT

	CASE go='6'
	@ 14, 8 SAY '*'
	@ 20, 0
	DO BAL

	CASE go='7'
	@ 15, 8 SAY '*'
	@ 20, 0
	ERASE
	@ 5, 0 SAY 'ENTER A Y TO CHANGE SYSTEM DATE FROM :'+DATE()
	SET CONSOLE OFF
	WAIT TO change
	SET CONSOLE ON

		IF !(change) = 'Y'
		ERASE
		STORE T TO go
		DO WHILE go 
			STORE '        ' to mdate
			@ 13, 19 SAY 'ENTER DATE' GET mdate PICTURE '99/99/99'
			READ
			IF VAL($(mdate,7,2))<80;
			.OR. VAL($(mdate,1,2))<1 .OR. VAL($(mdate,1,2))>12;
			.OR. VAL($(mdate,4,2))<1 .OR. VAL($(mdate,4,2))>31;
			.OR. (VAL($(mdate,1,2))=2 .AND. VAL($(mdate,4,2))>29)
			@ 15,19 SAY 'INCORRECT DATE - PLEASE TRY AGAIN'
			STORE 0 TO X
				DO WHILE X < 55
				STORE X+1 TO X
				ENDDO
			@ 15, 0
			@ 13, 0
			LOOP
			ELSE
			SET DATE TO &mdate
			RELE mdate
			STORE F TO go
			ENDIF
		ENDDO
		STORE $(date(),7,2) TO year
		ENDIF

	@ 7, 0 SAY 'ENTER A Y TO CHANGE TO OTHER CHECKBOOK'
	@ 8, 0 SAY 'CHECKBOOK IS CURRENTLY :'+maccount
	SET CONSOLE OFF
	WAIT TO change
	SET CONSOLE ON

		IF !(change) = 'Y'
		ERASE
		@ 10, 10 SAY 'SELECT CHECK BOOK'     
		@ 12, 10 SAY '1  - Personal Account'
		@ 14, 10 SAY '2  - Business Account'
		SET CONSOLE OFF
		WAIT TO file
		SET CONSOLE ON

			IF file = '1'
			USE PERSONAL
			STORE 'PERSONAL' TO maccount
			STORE per:no TO ac:no
			STORE curbal TO busbal
			STORE perbal TO curbal
			ELSE
			USE BUSINESS
			STORE 'BUSINESS' TO maccount
			STORE bus:no TO ac:no
			STORE curbal TO perbal
			STORE busbal TO curbal
			ENDIF
		ENDIF       
	RELEASE change
	
	CASE go='8'
	@ 16, 8 SAY '*'
	@ 20, 0
	DO B:HELP

	CASE go='9'
	@ 17, 8 SAY '*'
	@ 20, 0
	DO B:ARCHIVE

	CASE !(go)='X'
	@ 18, 8 SAY '*'
	@ 20, 0
	RELEASE which, recnum, maccount, go, next, drive, dbf, maxdrive, ;
	year, fyear, ac:no
	IF file = '1' 
	STORE curbal TO perbal 
	ELSE 
	STORE curbal TO busbal
	ENDIF 
	RELEASE curbal, file
	SAVE TO INFO
	QUIT

	ENDCASE

ENDDO
curbal TO perbal 
	ELSE 
	STORE curbal TO busbal
	ENDIF 
	RELEASE cur