Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : HOMFIN.ZIP
Filename : TRENTER.CMD

 
Output of file : TRENTER.CMD contained in archive : HOMFIN.ZIP
** TRENTER **
* Copyright 1987 John R. Yandrasitz / 168 Brooklea Rd / Rosemont PA 19010
* Entry of transactions into TRACS database
* Updates budget data in CATEG, account data in ACCTS
* Split records are against a total record NOT entered into TRACS
* JRY 05/25/86

ERASE
SET COLON OFF
SELECT PRIMARY
IF pfile # ddr + 'TRACS'
STORE ddr + 'TRACS' TO pfile
USE &pfile INDEX &pfile
ENDIF

STORE " " TO ac1
STORE " " TO ac2
STORE " " TO ac1nam
STORE " " TO ac2nam
STORE 0 TO ac1bal
STORE 0 TO ac2bal
STORE " " TO acls
STORE " " TO acopen
STORE today TO mdate
STORE 0 TO lin
STORE ' ' TO mtype
STORE ' ' TO mnum
STORE 0 TO aclnum
STORE 0.00 TO mamt
STORE 1 TO tr

@ 1,1 SAY "Account 1"
@ 2,1 SAY "Account 2"
@ 3,1 SAY "Date TP ACCT NMBR From / To "
@ 3,62 SAY "TX Amount Budgt"
SET INTENSITY OFF
@ 15,1 SAY "---------------------------------------"
@ 15,40 SAY "---------------------------------------"

STORE T TO more
DO WHILE more
CLEAR GETS
@ 1,50
@ 2,50
@ 1,50 SAY ac1bal
@ 2,50 SAY ac2bal

* If 10 lines on screen, clear and redisplay last 4 transactions
IF lin > 9
STORE 0 TO lin
@ 5,1 SAY clr
SELECT PRIMARY
* Time to force update of database on disk
USE &pfile INDEX &pfile
GO BOTT
SKIP-3
DO WHILE .NOT. EOF
@ lin+5,1 SAY DATE+' '+TTYPE+' '+ACCT+' '+NO+' '+TNAME+' '+TAX
@ $,64 SAY AMT
@ $,75 SAY CAT
STORE lin+1 TO lin
SKIP
ENDDO
@ 15,1 SAY "---------------------------------------"
@ 15,40 SAY "---------------------------------------"
ENDIF

* Set up variables for next transaction
STORE lin+5 TO y
STORE ' ' TO mcat
STORE ' ' TO mtax
STORE ' ' TO acin
IF tr=1
STORE 'P' TO mtype
STORE ' ' TO mnam
ENDIF

**** Enter a transaction ****
STORE F TO ok
DO WHILE .NOT. ok
@ 16,1 SAY clr
* Get date, mtype, ac1(2) on first transaction of split
IF tr = 1
STORE F TO ck
@ 22,1 SAY "Set month to '00' to exit"
DO WHILE .NOT. ck
@ y,1 GET mdate PICTURE '99/99/99'
READ
IF $(mdate,2,1)=' '
STORE '0' + $(mdate,1,1) + $(mdate,3,6) TO mdate
@ y,1 SAY mdate
ENDIF
IF (VAL($(mdate,1,2)) >= 0) .AND. (VAL($(mdate,1,2)) < 13)
STORE T TO ck
ENDIF
ENDDO
IF VAL($(mdate,1,2)) = 0
STORE T TO ok
LOOP
ENDIF

* GET mtype
@ 16,1 SAY clr
@ 16,5 SAY "P - Payment S - Split Payment "
@ 17,5 SAY "D - Deposit T - Transfer "
@ 18,5 SAY "I - Interest received C - Charges (Interest) Paid"
STORE F TO ck
DO WHILE .NOT. ck
@ y,10 GET mtype PICTURE '!'
READ
IF @(mtype,typlst) # 0
STORE T TO ck
ENDIF
ENDDO

* Get account1 and open if necessary
STORE " " TO acin
DO WHILE acin = " "
@ 16,1 SAY clr
@ 16,1 SAY anam1
@ 17,1 SAY anam2
@ 18,1 SAY anam3
@ 19,1 SAY anam4
@ 20,1 SAY anam5

STORE ac1 to acin
@ y,12 GET acin PICTURE '!!!!'
@ 22,0
@ 22,1 SAY "Enter 'LIST' for Account List "
READ
CLEAR GETS

DO CASE
CASE acin = " "

CASE acin = "LIST"
DO ACLIST

CASE acin # ac1
SELECT SECONDARY
IF sfile # ddr+"ACCTS"
STORE ddr + "ACCTS" TO sfile
USE &sfile INDEX &sfile
ENDIF

IF acin = ac2
STORE "ac2" TO acls
DO ACCOUNTS
@ 2,12
ENDIF

IF ac1 # " "
STORE "ac1" TO acls
ENDIF
STORE "ac1" TO acopen
DO ACCOUNTS
@ 1,12
@ 1,12 SAY ac1 + " " + ac1nam
@ 1,50 SAY ac1bal
ENDCASE
ENDDO
@ 21,1 SAY clr
* Get account2 and open if necessary
IF mtype = "T"

STORE " " TO acin
DO WHILE acin = " "
@ 16,1 SAY clr
@ 16,1 SAY anam1
@ 17,1 SAY anam2
@ 18,1 SAY anam3
@ 19,1 SAY anam4
@ 20,1 SAY anam5
STORE ac2 to acin
SET INTENSITY ON
@ 21,1 SAY "Enter Account to Transfer to " GET acin PICTURE '!!!!'
@ 22,1 SAY "Enter 'LIST' for Account List "
SET INTENSITY OFF
READ

DO CASE
CASE acin = " "

CASE acin = ac1
STORE " " TO acin

CASE acin = "LIST"
DO ACLIST

CASE acin # ac2
SELECT SECONDARY
IF sfile # ddr+"ACCTS"
STORE ddr + "ACCTS" TO sfile
USE &sfile INDEX &sfile
ENDIF

IF ac2 # " "
STORE "ac2" TO acls
ENDIF
STORE "ac2" TO acopen
DO ACCOUNTS
@ 2,12
@ 2,12 SAY ac2 + " " + ac2nam
@ 2,50 SAY ac2bal
ENDCASE
ENDDO
@ 21,0 SAY clr
STORE 'to ' + ac2 + ' ' TO mnam
ENDIF

ELSE
@ y,1 SAY mdate
@ y,10 SAY mtype + ' ' + ac1
ENDIF

* Set up next check number for payment
CLEAR GETS
DO CASE
CASE tr > 1
STORE $(mnum,1,4) + CHR(63+tr) TO mnum
CASE (mtype='D') .OR. (mtype='I') .OR. (mtype='C')
STORE ' ' TO mnum
CASE aclnum > 0
STORE STR((aclnum+1),4) + ' ' TO mnum
@ y,17 GET mnum PICTURE 'XXXX'
READ
OTHERWISE
STORE ' ' TO mnum
@ y,17 GET mnum PICTURE 'XXXX'
READ
ENDCASE

IF tr=1 .AND. VAL(mnum) > 0
STORE STR(VAL(mnum),4) + ' ' TO mnum
ENDIF
@ y,17 SAY mnum

@ y,23 GET mnam
@ y,61 SAY "| |"
READ

* GET Tax Status - Invoke Calculator on *
@ 22,0
@ 22,1 SAY "D - Deductable C - Credit * - Calculator"

STORE F TO ck
DO WHILE .NOT. ck
@ y,62 GET mtax PICTURE '!'
READ
DO CASE
CASE (mtax=' ') .OR. (mtax='C') .OR. (mtax='D')
STORE T TO ck

CASE mtax = '*'
STORE " " TO temp
SET INTENSITY ON
SET COLON ON
@ 21,1 SAY "Enter expression *: " GET temp
SET INTENSITY OFF
READ
SET COLON OFF
@ 21,0
@ 21,1 SAY temp + "= "
IF TEST(&temp) # 0
@ 21,35 SAY &temp
ELSE
@ 21,35 SAY '0'
ENDIF
RELEASE temp
ENDCASE
ENDDO
CLEAR GETS

IF tr=1 .AND. mtype='S'
@ 22,0
SET INTENSITY ON
@ 22,10 SAY "Enter <<< TOTAL >>> amount now "
SET INTENSITY OFF
ENDIF
@ y,64 GET mamt PICTURE '999999.99'
READ

* GET budget categories for mtype = P,T,D, or S(tr>1)
DO CASE
CASE mtype='S' .AND. tr=1
CASE mtype='C' .OR. mtype='I'

OTHERWISE
@ 16,1 SAY clr
@ 16,1 SAY bnam1
@ 17,1 SAY bnam2
@ 18,1 SAY bnam3
@ 19,1 SAY bnam4
@ 20,1 SAY bnam5

STORE F TO ck
DO WHILE .NOT. ck
@ y,75 GET mcat PICTURE '!!!!'
READ
DO CASE
CASE mcat = " " .OR. mcat$bnam1 .OR. mcat$bnam2
STORE T TO ck
CASE mcat$bnam3 .OR. mcat$bnam4 .OR. mcat$bnam5
STORE T TO ck
ENDCASE
ENDDO
ENDCASE
CLEAR GETS

@ 22,0
SET INTENSITY ON
@ 22,40 SAY "Information correct (y/n)? " GET ok
READ
SET INTENSITY OFF
ENDDO

SET INTENSITY ON
IF VAL($(mdate,1,2)) = 0
@ 22,0
@ 22,40 SAY "CLOSING Accounts"
SELECT SECONDARY
IF sfile # ddr+"ACCTS"
STORE ddr + "ACCTS" TO sfile
USE &sfile INDEX &sfile
ENDIF
IF ac1 # " "
STORE "ac1" TO acls
DO ACCOUNTS
ENDIF
IF ac2 # " "
STORE "ac2" TO acls
DO ACCOUNTS
ENDIF
STORE F TO more
LOOP
ENDIF

STORE lin+1 to lin

* Append record update budget
IF mtype # 'S' .OR. (mtype='S' .AND. tr>1)
@ 22,0
@ 22,1 SAY "Adding Transaction to File"
SELECT PRIMARY
IF pfile # ddr + 'TRACS'
STORE ddr + 'TRACS' TO pfile
USE &pfile INDEX &pfile
ENDIF

APPEND BLANK
REPLACE DATE WITH mdate, ACCT WITH ac1, NO WITH mnum, TTYPE WITH mtype
REPLACE TNAME WITH mnam, AMT WITH mamt, CAT WITH mcat, TAX WITH mtax
REPLACE CAN WITH acan, NX WITH #

IF mtype = 'T'
APPEND BLANK
REPLACE DATE WITH mdate, ACCT WITH ac2, TTYPE WITH 'D'
REPLACE TNAME WITH 'from ' + ac1, AMT WITH mamt, TAX WITH mtax
REPLACE NX WITH #
ENDIF
ENDIF

* Update budget info
IF mcat # ' ' .AND. $(mdate,7,2) = $(today,7,2)
@ 22,40 SAY "Updating Budget Categories File"
SELECT SECONDARY
IF sfile # ddr+"CATEG"
STORE ddr + "CATEG" TO sfile
USE &sfile INDEX &sfile
ENDIF

STORE $(mdate,1,2) + mcat TO mfind
FIND &mfind
REPLACE SP WITH SP + mamt
IF BUD # 0
REPLACE PCT WITH INT(100*SP/BUD+.5)
ENDIF
RELEASE mfind

ENDIF
SET INTENSITY OFF
@ 22,0

* Update balances and mamt
DO CASE
CASE (mtype='D') .OR. (mtype='I')
STORE ac1bal + mamt TO ac1bal

CASE mtype = 'T'
STORE ac1bal - mamt TO ac1bal
STORE ac2bal + mamt TO ac2bal

CASE mtype = 'S' .AND. tr=1
STORE mamt TO mtot
OTHERWISE
STORE ac1bal - mamt TO ac1bal
ENDCASE

IF tr=1
STORE 0.00 TO mamt
ENDIF

IF mtype = 'S'
STORE tr+1 TO tr
STORE mtot - mamt TO mtot
STORE mtot TO mamt
IF mtot <= 0

STORE 0.00 TO mamt
STORE 'P' TO mtype
STORE 1 TO tr
ENDIF
ENDIF

* mnum increments aclnum if numeric and greater
IF VAL(mnum) > aclnum
STORE VAL(mnum) TO aclnum
ENDIF

ENDDO
SET INTENSITY ON
@ 22,40 SAY "RETURNING TO MAIN MENU "
RELEASE ALL LIKE m???????
RELEASE ALL LIKE ac??????
RELEASE lin,tr,x,y,ok,ck
SET COLON ON
SELECT PRIMARY
RETURN


  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : HOMFIN.ZIP
Filename : TRENTER.CMD

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/