home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
database
/
ledgers.lbr
/
LACCOUNT.CZD
/
LACCOUNT.CMD
Wrap
OS/2 REXX Batch file
|
1987-05-10
|
7KB
|
267 lines
NOTE * Program...: LACCOUNT.CMD
NOTE * Version...: 2.0
NOTE * Author....: Terry Hazen
NOTE * Date......: 12/06/85
NOTE * Notice....: Copyright (c) 1985, n/SYSTEMS
USE laccount
STORE ' ' TO amenu
STORE "a:name, a:number + ' ', a:category" TO afields
STORE "&srvideo + $(STR(0,80),1,19) + '<<< A C C O U N T F I L E S >>>'+ $(STR(0,80),1,23) + &snvideo" TO astatline
@ 04,00 SAY &setoend
@ 04,00 SAY 'Account Name No. Categories '
@ 05,00 SAY '==================================================='
@ $,$+1 SAY '============================='
@ 16,00 SAY '==================================================='
@ $,$+1 SAY '============================='
@ 16,00 SAY '='
? &astatline
GO TOP
STORE # TO arecord
@ 05,00 SAY '='
DISPLAY WHILE # <= arecord + 9 OFF FIELDS &afields
DO WHILE T
@ 18,00 SAY &setoend
@ 19,07 SAY ' A - Add Account '
@ 19,30 SAY ' S - Search '
@ 19,53 SAY ' L - View Last Page '
@ 20,07 SAY ' E - Edit Account '
@ 20,53 SAY ' N - View Next Page '
@ 21,29 SAY '<RET> to Main Menu '
STORE ' ' TO amenu
CLEAR GETS
@ 23,16 SAY 'Select Choice: ' GET amenu PICTURE '!'
READ
@ 23,00
CLEAR GETS
DO CASE
CASE amenu = 'A'
@ 18,00 SAY &setoend
STORE $(STR(0,80),1,27) TO aname
STORE $(STR(0,80),1,3) TO anumber
STORE $(STR(0,80),1,8) TO acategory
STORE ' ' TO aok
@ 19,00 SAY 'Account Name.............' GET aname
READ
IF TRIM(aname) <> ' '
@ 20,00 SAY 'Account Number...........' GET anumber PICTURE '999'
@ 21,00 SAY 'Categories...............'
@ $,$+1 GET acategory PICTURE '!!!!!!!!'
@ 23,00 SAY 'Enter <RET> when entry is OK and ready to post...'
@ $,$+1 GET aok PICTURE '!'
READ
CLEAR GETS
GO BOTTOM
APPEND BLANK
REPLACE a:name WITH aname, a:number WITH anumber
REPLACE a:category WITH acategory
STORE T TO asortflag
@ 22,00 SAY &setoend
@ 22,00 SAY 'Sorting Account File by Account Number...'
SORT ON a:number TO temp
USE
DELETE FILE laccount.dbf
RENAME temp TO laccount
USE laccount
@ 22,00
LOCATE FOR a:name = aname
STORE # TO arecord
GO BOTTOM
SKIP -9
IF arecord > #
STORE # TO arecord
ENDI
GOTO arecord
@ 05,00 SAY '='
DISPLAY WHILE # <= arecord + 9 OFF FIELDS &afields
ENDI
CASE amenu = 'E'
@ 18,00 SAY &setoend
STORE $(STR(0,80),1,27) TO aname
STORE $(STR(0,80),1,8) TO acategory
STORE $(STR(0,80),1,3) TO anumber
STORE ' ' TO aok
@ 20,00 SAY 'Account Number...........' GET anumber PICTURE '999'
READ
CLEAR GETS
IF anumber <> ' '
LOCATE FOR VAL(a:number) = VAL(anumber)
IF .NOT. EOF
STORE # TO arecord
STORE a:name TO aname
STORE a:number TO anumber
STORE a:category TO acategory
@ 20,25 SAY anumber
@ 19,00 SAY 'Account Name.............' GET aname
@ 21,00 SAY 'Categories...............'
@ $,$+1 GET acategory PICTURE '!!!!!!!!'
@ 19,25 SAY &srvideo + aname
@ 21,25 SAY &srvideo + acategory
@ 23,00 SAY 'Enter <RET> when entry is OK and ready to post...'
@ $,$+1 GET aok PICTURE '!'
READ
CLEAR GETS
REPLACE a:name WITH aname, a:number WITH anumber
REPLACE a:category WITH acategory
GO BOTTOM
SKIP -9
IF arecord > #
STORE # TO arecord
ENDI
GOTO arecord
@ 05,00 SAY '='
DISPLAY WHILE # <= arecord + 9 OFF FIELDS &afields
ENDI
ENDI
CASE amenu = 'L'
@ 19,53 SAY &srvideo + ' --> VIEW LAST PAGE ' + &snvideo
@ 23,00
STORE arecord - 10 TO arecord
IF arecord < 1
STORE 1 TO arecord
ENDI
GOTO arecord
@ 05,00 SAY '='
DISPLAY WHILE # <= arecord + 9 OFF FIELDS &afields
@ 19,53 SAY ' L - View Last Page '
@ 23,00
CASE amenu = 'N'
@ 20,53 SAY &srvideo + ' --> VIEW NEXT PAGE ' + &snvideo
@ 23,00
STORE arecord + 10 TO arecord
GO BOTTOM
IF arecord + 9 > #
SKIP -9
STORE # TO arecord
ELSE
GOTO arecord
ENDI
@ 05,00 SAY '='
DISPLAY WHILE # <= arecord + 9 OFF FIELDS &afields
@ 20,53 SAY ' N - View Next Page '
@ 23,00
CASE amenu = 'S'
@ 19,30 SAY &srvideo + ' --> SEARCH '
@ 23,00
@ 18,00 SAY &setoend
STORE 'X' TO akey
DO WHILE .NOT. akey$'AN '
STORE ' ' TO akey
@ 19,08 SAY 'Search for Account Name (A) '
@ $,$+1 SAY 'or Account Number (N)?...'
@ $,$+1 GET akey PICTURE '!'
READ
CLEAR GETS
ENDD
@ 18,0 SAY &setoend
DO CASE
CASE akey = ' '
LOOP
CASE akey = 'N'
STORE ' ' TO anumber
@ 19,08 SAY 'Enter Account Number...' GET anumber
READ
LOCATE FOR VAL(a:number) = VAL(anumber)
IF .NOT. EOF
STORE # TO arecord
GO BOTTOM
IF arecord + 9 > #
SKIP -9
STORE # TO arecord
ELSE
GOTO arecord
ENDI
@ 5,0 SAY '='
DISPLAY OFF FIELDS &afields
SKIP
DISPLAY WHILE # <= arecord + 9 OFF FIELDS &afields
ELSE
STORE ' ' TO aok
@ 18,00 SAY &setoend
@ 21,08 SAY '+++ No other Account Entry matches these '
@ $,$+1 SAY 'specifications +++ '
@ 23,08 SAY 'Hit any key to continue...' GET aok
READ
ENDI
CASE akey = 'A'
STORE $(STR(0,80),1,27) TO aname
STORE 'F' TO aok
DO WHILE aok = 'F'
@ 19,08 SAY "Enter Account Name..."
@ 19,$+1 GET aname PICTURE '!!!!!!!!!!!!!!!!!!!!!!!!!!!'
READ
CLEAR GETS
STORE TRIM(aname) TO aname
IF aname = ' '
LOOP
ELSE
STORE 'C' TO aok
ENDI
ENDD
LOCATE FOR aname$!(a:name)
STORE # TO arecord
STORE 1 TO l
@ 5,0 SAY '='
DO WHILE aok = 'C'
DO WHILE l < 11
IF EOF
STORE l + 5 TO cn
@ cn,0
ELSE
DISPLAY OFF FIELDS &afields
CONTINUE
ENDI
STORE l + 1 TO l
ENDD
IF .NOT. EOF
STORE ' ' TO aok
@ 19,08 SAY "Enter 'C' to continue or <RET> to "
@ 19,$+1 SAY 'return to Menu...' GET aok PICTURE '!'
READ
IF aok = 'C'
STORE 1 TO l
@ 5,0 SAY '='
ENDI
ELSE
STORE ' ' TO aok
ENDI
ENDD
ENDC
CASE amenu = 'Q'
@ 21,00
@ 21,28 SAY &srvideo + ' --> QUIT TO dBASE II ' + &snvideo
@ 23,00
SAVE TO lsystem ALL LIKE s*
SAVE TO &tledger ALL LIKE m*
CANCEL
CASE amenu = 'X'
@ 21,00
@ 21,28 SAY &srvideo + ' --> EXIT TO CP/M ' + &snvideo
@ 23,00
SAVE TO lsystem ALL LIKE s*
SAVE TO &tledger ALL LIKE m*
QUIT
CASE amenu = ' '
@ 21,00
@ 21,28 SAY &srvideo + ' --> MAIN MENU ' + &snvideo
@ 23,00
RELEASE ALL LIKE a*
USE &tledger
@ 04,00 SAY &setoend
@ 04,00 SAY 'CkNo Tr Date Payee Memo '
@ $,$+1 SAY ' Acct Amount'
@ 05,00 SAY '===================================================='
@ $,$+1 SAY '============================'
@ 16,00 SAY '===================================================='
@ $,$+1 SAY '============================'
GO BOTTOM
SKIP -9
STORE # TO xrecord
@ 05,00 SAY '='
DISPLAY WHILE # <= xrecord + 10 OFF FIELDS &lfields
@ 16,00 SAY '='
? &tstatline
RETU
ENDC
ENDD
RETU @ 21,28 SAY &srvideo + ' --> EXIT TO CP/M ' + &snvideo @ 23,00 SAVE TO lsystem ALL LIKE s*