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

 
Output of file : VIEWEDIT.CMD contained in archive : HOMFIN.ZIP

*** VIEWEDIT ***
* Copyright 1987 John R. Yandrasitz / 168 Brooklea Rd / Rosemont PA 19010
* Allows page by page viewing of transactions
* For editing highlights transactions singly; calls TREDIT for changes
* JRY 5/29/86

SELECT PRIMARY
STORE tdr + 'TEMP' to tfile
USE &tfile
GO BOTT
STORE # to mlast
GO TOP
ERASE
@ 1,24 SAY " View / Edit Transactions "
@ 1,68 SAY today
@ 2,0 SAY "C Date TP ACCT NMBR From / To "
@ 2,62 SAY "TX Amount Budgt"
SET INTENSITY OFF
@ 14,1 SAY "---------------------------------------"
@ 14,40 SAY "---------------------------------------"
@ 15,5 SAY "File " + mlim1
@ 16,5 SAY mlim2
@ 17,5 SAY mlim3
@ 18,5 SAY mlim4
RELEASE ALL LIKE mlim??
IF mlast=0
@ 23,0 SAY clr
SET INTENSITY ON
@ 23,10 SAY "No records extracted!"
WAIT
@ 23,40 SAY "RETURNING TO MAIN MENU"
STORE ddr + 'TRACS' TO pfile
USE &pfile INDEX &pfile
RELEASE mlast
RETURN
ENDIF

STORE 1 TO mtop
STORE F TO mdone
STORE F TO medit
DO WHILE .NOT. mdone
GOTO mtop
STORE 0 TO mlin

* Display a page of transactions (10)
DO WHILE .NOT. EOF .AND. mlin<10 .AND. .NOT. medit
IF CAN
@ mlin+4,0 SAY "*"
ELSE
@ mlin+4,0 SAY " "
ENDIF
@ mlin+4,1 SAY DATE+' '+TTYPE+' '+ACCT+' '+NO+' '+TNAME+' '+TAX+' '
@ $,64 SAY AMT
@ $,73 SAY ' ' + CAT
STORE mlin+1 TO mlin
SKIP
ENDDO

* Blank out extra lines on EOF
DO WHILE mlin <10 .AND. .NOT. medit
@ mlin+4,0
STORE mlin+1 to mlin
ENDDO

STORE F TO mck
STORE ' ' TO mans
STORE F TO medit
@ 23,0 SAY clr
@ 23,5 SAY " Next

Previous Edit Quit"
DO WHILE .NOT. mck
@ 23,68 GET mans PICTURE '!'
READ
CLEAR GETS

DO CASE
CASE mans = 'Q'
STORE T TO mdone
STORE T TO mck

CASE mans = 'N' .AND. mtop+10 <= mlast
STORE mtop+10 TO mtop
STORE T TO mck

CASE mans = 'P' .AND. mtop-10 > 0
STORE mtop-10 TO mtop
STORE T TO mck

CASE mans = 'E'
STORE T TO medit
STORE T TO mck
ENDCASE
ENDDO

IF medit
STORE 0 TO mlin
IF mlast - mtop > 9
STORE 9 TO mend
ELSE
STORE mlast-mtop TO mend
ENDIF
@ 23,0 SAY clr
SET INTENSITY ON
@ 23,5 SAY " Up Down Edit Quit "

STORE F TO mck
DO WHILE .NOT. mck
STORE mtop + mlin TO mrec
GOTO mrec
SET INTENSITY ON
IF CAN
@ mlin+4,0 SAY "*"
ELSE
@ mlin+4,0 SAY " "
ENDIF
@ mlin+4,1 SAY DATE+' '+TTYPE+' '+ACCT+' '+NO+' '+TNAME+' '+TAX+' '
@ $,64 SAY AMT
@ $,73 SAY ' ' + CAT
SET INTENSITY OFF
STORE ' ' TO mans
@ 23,65 GET mans PICTURE '!'
READ
CLEAR GETS

IF mans='Q' .OR. mans='U' .OR. mans='D' .OR. mans='E'
IF CAN
@ mlin+4,0 SAY "*"
ELSE
@ mlin+4,0 SAY " "
ENDIF
@ mlin+4,1 SAY DATE+' '+TTYPE+' '+ACCT+' '+NO+' '+TNAME+' '+TAX+' '
@ $,64 SAY AMT
@ $,73 SAY ' ' + CAT
ENDIF

DO CASE
CASE mans = 'Q'
STORE T TO mck

CASE mans = 'U' .AND. mlin >0
STORE mlin-1 TO mlin
CASE mans = 'U'
STORE mend TO mlin

CASE mans = 'D' .AND. mlin < mend
STORE mlin+1 TO mlin
CASE mans = 'D'
STORE 0 TO mlin

CASE mans = 'E'
SET ESCAPE OFF
DO TREDIT
SET ESCAPE ON
ENDCASE

ENDDO
ENDIF
ENDDO

SET INTENSITY ON
@ 23,0 SAY clr
@ 23,40 SAY "RETURNING TO MAIN MENU"
STORE ddr + 'TRACS' TO pfile
IF sfile = pfile
SELECT SECONDARY
STORE ' ' TO sfile
USE
SELECT PRIMARY
ENDIF
USE &pfile INDEX &pfile
RELEASE ALL LIKE m???????
RETURN