home *** CD-ROM | disk | FTP | other *** search
-
- NOTE * Program...: LINSTALL.CMD
- NOTE * Version...: 1.2
- NOTE * Author....: Terry Hazen
- NOTE * Date......: 10/21/85
- NOTE * Notice....: Copyright (c) 1985, n/SYSTEMS
- SET TALK OFF
- SET COLON OFF
- SET ESCAPE OFF
- SET BELL OFF
- ERASE
- TEXT
- +---------------------------------------------------------------------------+
- | |
- | L E D G E R S I N S T A L L A T I O N P R O G R A M |
- | |
- +---------------------------------------------------------------------------+
- ...Copyright (c) 1985, n/SYSTEMS
- ENDT
- DO WHILE T
- @ 07,05 SAY 'Select the desired function:'
- @ 10,20 SAY 'S - Set up or modify your Terminal Screen Control'
- @ 11,28 SAY 'Sequences (Normally required only when'
- @ 12,28 SAY 'first installing LEDGER)'
- @ 14,20 SAY 'L - Create a new Ledger Database File'
- @ 18,20 SAY 'Q - QUIT to dBASEII'
- @ 22,05 SAY 'Select Choice: '
- STORE ' ' TO choice
- @ $,$+1 GET choice PICTURE '!'
- READ
- CLEAR GETS
- DO CASE
- CASE choice = 'S'
- IF FILE('lsystem.mem')
- RESTORE FROM lsystem ADDITIVE
- STORE $(STR(0,80),1,20) TO line
- STORE &srvideo TO trvideo
- STORE &snvideo TO tnvideo
- STORE srvideo + $(line,1,20-LEN(srvideo)) TO srvideo
- STORE snvideo + $(line,1,20-LEN(snvideo)) TO snvideo
- STORE setoend + $(line,1,20-LEN(setoend)) TO setoend
- @ 06,00 SAY &setoend
- ELSE
- STORE '01JAN86' TO sdate
- STORE "CHR(27)+'[7m' " TO srvideo
- STORE "CHR(27)+'[m' " TO snvideo
- STORE "CHR(27)+'[J' " TO setoend
- STORE CHR(01) TO trvideo
- STORE CHR(01) TO tnvideo
- @ 06,0
- @ 07,0
- @ 08,0
- @ 09,0
- @ 10,0
- @ 11,0
- @ 12,0
- @ 13,0
- @ 14,0
- @ 15,0
- @ 16,0
- @ 17,0
- @ 18,0
- @ 19,0
- @ 20,0
- @ 21,0
- @ 22,0
- ENDI
- @ 00,00
- ?
- ?
- ?
- ?
- TEXT
- Change the following screen control sequences to suit your own terminal. The
- sequences shown are for a VT100 and illustrate the proper method of entry.
- For example, the Reverse Video sequence is ESCAPE [ 7 m. ESCAPE is entered
- as CHR(27), the decimal code for ESCAPE, followed by a + and the remainder of
- the sequence in single quotes. Decimal codes or printable characters must be
- used. A <RET> will leave an entry as it is shown.
-
- If your terminal does not support Reverse Video, enter CHR(01) as the start
- and end sequences. The displays will be useable, but not as easy to read.
- ENDT
- STORE ' ' TO tret
- STORE 16 TO drow
- STORE 47 TO dcol
- @ 16,00 SAY 'Enter desired initial date.....................'
- DO ldate
- @ 17,00 SAY 'Sequence to start REVERSE VIDEO................'GET srvideo
- @ 18,00 SAY 'Sequence to end REVERSE VIDEO..................'GET snvideo
- @ 19,00 SAY 'Sequence to ERASE from CURSOR to END of SCREEN.'GET setoend
- @ 20,00 SAY "Enter a <RET> here when you're finished........"GET tret
- READ
- CLEAR GETS
- STORE ' ' TO tret
- @ 20,00
- @ 20,00 SAY &srvideo+ '<<<< This line should appear in REVERSE VIDEO >>>>'
- @ 22,00 SAY 'When you hit <RET>, you should return to the main menu.'
- @ 23,00 SAY "If the screen didn't erase properly, hit 'Q' to exit, "
- @ $,$+1 SAY 'and retry:'
- @ $,$+2 GET tret
- READ
- CLEAR GETS
- STORE TRIM(srvideo) TO srvideo
- STORE TRIM(snvideo) TO snvideo
- STORE TRIM(setoend) TO setoend
- SAVE TO lsystem ALL LIKE s*
- @ 6,0 SAY &setoend
- CASE choice = 'L'
- @ 06,0
- @ 07,0
- @ 10,0
- @ 11,0
- @ 12,0
- @ 14,0
- @ 18,0
- @ 22,0
- @ 06,00 SAY 'This command creates new .DBF and .MEM files '
- @ $,$+1 SAY 'for a new Ledger number you'
- @ 07,00 SAY 'select. Ledger1 is the initial file. '
- @ $,$+1 SAY 'You may enter a number up through 9.'
- @ 09,00 SAY 'If the file already exists, you will have to delete '
- @ $,$+1 SAY 'it and re-run LINSTALL.'
- @ 10,00 SAY 'This extra step is a protection against the accidental '
- @ $,$+1 SAY 'deletion of a valuable '
- @ 11,00 SAY 'LEDGER Database File.'
- IF .NOT. FILE ('linstall.dbf')
- STORE ' ' TO ok
- @ 13,00 SAY '+++ The file LINSTALL.DBF is not present +++'
- @ 15,00 SAY 'LINSTALL.DBF must be present on the disk '
- @ $,$+1 SAY 'to create new LEDGER Database Files.'
- @ 17,00 SAY 'Hit any key to continue...' GET ok
- READ
- CLEAR GETS
- @ 06,0
- @ 07,0
- @ 09,0
- @ 10,0
- @ 11,0
- @ 13,0
- @ 15,0
- @ 17,0
- LOOP
- ENDI
- IF .NOT. FILE('lsystem.mem')
- STORE ' ' TO ok
- @ 13,00 SAY '+++ System memory has not yet been established +++'
- @ 14,04 SAY "Use the 'S' command first..."
- @ 16,00 SAY 'Hit any key to continue...' GET ok
- READ
- CLEAR GETS
- @ 06,0
- @ 07,0
- @ 09,0
- @ 10,0
- @ 11,0
- @ 13,0
- @ 14,0
- @ 15,0
- @ 16,0
- LOOP
- ELSE
- @ 13,0 SAY 'The following LEDGER#.DBF files already exist...'
- ?
- DISPLAY FILES LIKE ledger??.dbf
- STORE ' ' TO number
- @ 20,00 SAY 'Enter the LEDGER number you want to create...'
- @ $,$+1 GET number PICTURE '9'
- READ
- CLEAR GETS
- IF number = ' '
- @ 06,00 SAY &setoend
- LOOP
- ENDI
- STORE 'LEDGER' + number TO filename
- IF .NOT. FILE(filename)
- @ 06,00 SAY &setoend
- @ 10,00 SAY 'Creating the file ' + filename + '.DBF...'
- USE linstall
- COPY TO &filename
- USE &filename
- @ 10,00 SAY filename + '.DBF has been created.'
- STORE number TO mledger
- STORE sdate TO xdate
- STORE ' ' TO mid
- STORE ' ' TO mcheck
- STORE 0.0 TO mbalance
- STORE 14 TO drow
- STORE 43 TO dcol
- STORE ' ' TO ok
- @ 12,00 SAY 'Enter the following initial values '
- @ $,$+1 SAY 'for the LEDGER...'
- @ 14,00 SAY 'Beginning Date.............................'
- DO ldate
- @ 15,00 SAY 'Ledger Identification (Bank Acct #, etc)...'
- @ $,$+1 GET mid
- @ 16,00 SAY 'Next Check Number..........................'
- @ $,$+1 GET mcheck PICTURE '9999'
- @ 17,00 SAY 'Beginning Balance..........................'
- @ $,$+1 GET mbalance PICTURE '999999.99'
- @ 20,00 SAY 'Hit <RET> when the values are OK and the '
- @ $,$+1 SAY '.MEM file can be created...' GET ok
- READ
- CLEAR GETS
- STORE STR(VAL(mcheck),4) TO mcheck
- APPEND BLANK
- REPLACE l:payee WITH 'Beginning Balance'
- REPLACE l:amount WITH mbalance
- REPLACE l:category WITH '000'
- REPLACE l:date WITH sdate
- REPLACE l:type WITH 'Dp'
- USE
- STORE xdate TO sdate
- SAVE TO &filename ALL LIKE m*
- RELEASE ALL LIKE m*
- ELSE
- STORE ' ' TO ok
- @ 18,00 SAY &setoend
- @ 18,00 SAY '+++ The file ' + filename + ' already exists +++'
- @ 20,00 SAY 'LINSTALL will not overwrite an existing .DBF '
- @ $,$+1 SAY 'file.'
- @ 22,00 SAY 'Hit any key to continue...' GET ok
- READ
- CLEAR GETS
- ENDI
- @ 06,00 SAY &setoend
- ENDI
- CASE choice = 'Q'
- RELEASE ALL
- ERASE
- RETU
- ENDC
- ENDD
- RETU....................'