home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / database / ledgers.lbr / LINSTALL.CZD / LINSTALL.CMD
Encoding:
Text File  |  1987-05-10  |  6.5 KB  |  234 lines

  1.  
  2. NOTE * Program...: LINSTALL.CMD
  3. NOTE * Version...: 1.2
  4. NOTE * Author....: Terry Hazen
  5. NOTE * Date......: 10/21/85
  6. NOTE * Notice....: Copyright (c) 1985,  n/SYSTEMS
  7. SET TALK OFF
  8. SET COLON OFF
  9. SET ESCAPE OFF
  10. SET BELL OFF
  11. ERASE
  12. TEXT
  13. +---------------------------------------------------------------------------+  
  14. |                                                                           |  
  15. |          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          |  
  16. |                                                                           |  
  17. +---------------------------------------------------------------------------+  
  18.                                             ...Copyright (c) 1985, n/SYSTEMS   
  19. ENDT
  20. DO WHILE T
  21. @ 07,05 SAY 'Select the desired function:'
  22. @ 10,20 SAY 'S - Set up or modify your Terminal Screen Control'
  23. @ 11,28 SAY 'Sequences (Normally required only when'
  24. @ 12,28 SAY 'first installing LEDGER)'
  25. @ 14,20 SAY 'L - Create a new Ledger Database File'
  26. @ 18,20 SAY 'Q - QUIT to dBASEII'
  27. @ 22,05 SAY 'Select Choice: '
  28. STORE ' ' TO choice
  29. @ $,$+1 GET choice PICTURE '!'
  30. READ
  31. CLEAR GETS
  32. DO CASE
  33. CASE choice = 'S'
  34. IF FILE('lsystem.mem')
  35. RESTORE FROM lsystem ADDITIVE
  36. STORE $(STR(0,80),1,20) TO line
  37. STORE &srvideo TO trvideo
  38. STORE &snvideo TO tnvideo
  39. STORE srvideo + $(line,1,20-LEN(srvideo)) TO srvideo
  40. STORE snvideo + $(line,1,20-LEN(snvideo)) TO snvideo
  41. STORE setoend + $(line,1,20-LEN(setoend)) TO setoend
  42. @ 06,00 SAY &setoend
  43. ELSE
  44. STORE '01JAN86' TO sdate
  45. STORE "CHR(27)+'[7m'       " TO srvideo
  46. STORE "CHR(27)+'[m'        " TO snvideo
  47. STORE "CHR(27)+'[J'        " TO setoend
  48. STORE CHR(01) TO trvideo
  49. STORE CHR(01) TO tnvideo
  50. @ 06,0
  51. @ 07,0
  52. @ 08,0
  53. @ 09,0
  54. @ 10,0
  55. @ 11,0
  56. @ 12,0
  57. @ 13,0
  58. @ 14,0
  59. @ 15,0
  60. @ 16,0
  61. @ 17,0
  62. @ 18,0
  63. @ 19,0
  64. @ 20,0
  65. @ 21,0
  66. @ 22,0
  67. ENDI
  68. @ 00,00
  69. ?
  70. ?
  71. ?
  72. ?
  73. TEXT
  74. Change the following screen control sequences to suit your own terminal.  The  
  75. sequences shown are for a  VT100 and illustrate the proper method  of  entry.  
  76. For example, the  Reverse Video sequence is ESCAPE [ 7 m.   ESCAPE is entered  
  77. as CHR(27), the decimal code for ESCAPE, followed by a + and the remainder of  
  78. the sequence in single quotes.  Decimal codes or printable characters must be  
  79. used.  A <RET> will leave an entry as it is shown.                             
  80.                                                                                
  81. If your terminal does not support Reverse Video,  enter  CHR(01) as the start  
  82. and end sequences.  The displays will be useable, but not as easy to read.     
  83. ENDT
  84. STORE ' ' TO tret
  85. STORE 16 TO drow
  86. STORE 47 TO dcol
  87. @ 16,00 SAY 'Enter desired initial date.....................'
  88. DO ldate
  89. @ 17,00 SAY 'Sequence to start REVERSE VIDEO................'GET srvideo
  90. @ 18,00 SAY 'Sequence to end REVERSE VIDEO..................'GET snvideo
  91. @ 19,00 SAY 'Sequence to ERASE from CURSOR to END of SCREEN.'GET setoend
  92. @ 20,00 SAY "Enter a <RET> here when you're finished........"GET tret
  93. READ
  94. CLEAR GETS
  95. STORE ' ' TO tret
  96. @ 20,00
  97. @ 20,00 SAY &srvideo+ '<<<<  This line should appear in REVERSE VIDEO  >>>>'
  98. @ 22,00 SAY 'When you hit <RET>, you should return to the main menu.'
  99. @ 23,00 SAY "If the screen didn't erase properly, hit 'Q' to exit, "
  100. @ $,$+1 SAY 'and retry:'
  101. @ $,$+2 GET tret
  102. READ
  103. CLEAR GETS
  104. STORE TRIM(srvideo) TO srvideo
  105. STORE TRIM(snvideo) TO snvideo
  106. STORE TRIM(setoend) TO setoend
  107. SAVE TO lsystem ALL LIKE s*
  108. @ 6,0 SAY &setoend
  109. CASE choice = 'L'
  110. @ 06,0
  111. @ 07,0
  112. @ 10,0
  113. @ 11,0
  114. @ 12,0
  115. @ 14,0
  116. @ 18,0
  117. @ 22,0
  118. @ 06,00 SAY 'This command  creates new  .DBF and  .MEM files '
  119. @ $,$+1 SAY 'for a new  Ledger  number you'
  120. @ 07,00 SAY 'select.  Ledger1 is the initial file.  '
  121. @ $,$+1 SAY 'You may enter a number up through 9.'
  122. @ 09,00 SAY 'If the file already exists,  you will have to delete '
  123. @ $,$+1 SAY 'it and re-run  LINSTALL.'
  124. @ 10,00 SAY 'This extra step is a protection against the accidental '
  125. @ $,$+1 SAY 'deletion of a valuable '
  126. @ 11,00 SAY 'LEDGER Database File.'
  127. IF .NOT. FILE ('linstall.dbf')
  128. STORE ' ' TO ok
  129. @ 13,00 SAY '+++ The file LINSTALL.DBF is not present +++'
  130. @ 15,00 SAY 'LINSTALL.DBF must be present on the disk '
  131. @ $,$+1 SAY 'to create new LEDGER Database Files.'
  132. @ 17,00 SAY 'Hit any key to continue...' GET ok
  133. READ
  134. CLEAR GETS
  135. @ 06,0
  136. @ 07,0
  137. @ 09,0
  138. @ 10,0
  139. @ 11,0
  140. @ 13,0
  141. @ 15,0
  142. @ 17,0
  143. LOOP
  144. ENDI
  145. IF .NOT. FILE('lsystem.mem')
  146. STORE ' ' TO ok
  147. @ 13,00 SAY '+++ System memory has not yet been established +++'
  148. @ 14,04 SAY "Use the 'S' command first..."
  149. @ 16,00 SAY 'Hit any key to continue...' GET ok
  150. READ
  151. CLEAR GETS
  152. @ 06,0
  153. @ 07,0
  154. @ 09,0
  155. @ 10,0
  156. @ 11,0
  157. @ 13,0
  158. @ 14,0
  159. @ 15,0
  160. @ 16,0
  161. LOOP
  162. ELSE
  163. @ 13,0 SAY 'The following LEDGER#.DBF files already exist...'
  164. ?
  165. DISPLAY FILES LIKE ledger??.dbf
  166. STORE ' ' TO number
  167. @ 20,00 SAY 'Enter the LEDGER number you want to create...'
  168. @ $,$+1 GET number PICTURE '9'
  169. READ
  170. CLEAR GETS
  171. IF number = ' '
  172. @ 06,00 SAY &setoend
  173. LOOP
  174. ENDI
  175. STORE 'LEDGER' + number TO filename
  176. IF .NOT. FILE(filename)
  177. @ 06,00 SAY &setoend
  178. @ 10,00 SAY 'Creating the file ' + filename + '.DBF...'
  179. USE linstall
  180. COPY TO &filename
  181. USE &filename
  182. @ 10,00 SAY filename + '.DBF has been created.'
  183. STORE number TO mledger
  184. STORE sdate TO xdate
  185. STORE '                        ' TO mid
  186. STORE '    ' TO mcheck
  187. STORE 0.0 TO mbalance
  188. STORE 14 TO drow
  189. STORE 43 TO dcol
  190. STORE ' ' TO ok
  191. @ 12,00 SAY 'Enter the following initial values '
  192. @ $,$+1 SAY 'for the LEDGER...'
  193. @ 14,00 SAY 'Beginning Date.............................'
  194. DO ldate
  195. @ 15,00 SAY 'Ledger Identification (Bank Acct #, etc)...'
  196. @ $,$+1 GET mid
  197. @ 16,00 SAY 'Next Check Number..........................'
  198. @ $,$+1 GET mcheck PICTURE '9999'
  199. @ 17,00 SAY 'Beginning Balance..........................'
  200. @ $,$+1 GET mbalance PICTURE '999999.99'
  201. @ 20,00 SAY 'Hit <RET> when the values are OK and the '
  202. @ $,$+1 SAY '.MEM file can be created...' GET ok
  203. READ
  204. CLEAR GETS
  205. STORE STR(VAL(mcheck),4) TO mcheck
  206. APPEND BLANK
  207. REPLACE l:payee WITH 'Beginning Balance'
  208. REPLACE l:amount WITH mbalance
  209. REPLACE l:category WITH '000'
  210. REPLACE l:date WITH sdate
  211. REPLACE l:type WITH 'Dp'
  212. USE
  213. STORE xdate TO sdate
  214. SAVE TO &filename ALL LIKE m*
  215. RELEASE ALL LIKE m*
  216. ELSE
  217. STORE ' ' TO ok
  218. @ 18,00 SAY &setoend
  219. @ 18,00 SAY '+++ The file ' + filename + ' already exists +++'
  220. @ 20,00 SAY 'LINSTALL will not overwrite an existing .DBF '
  221. @ $,$+1 SAY 'file.'
  222. @ 22,00 SAY 'Hit any key to continue...' GET ok
  223. READ
  224. CLEAR GETS
  225. ENDI
  226. @ 06,00 SAY &setoend
  227. ENDI
  228. CASE choice = 'Q'
  229. RELEASE ALL
  230. ERASE
  231. RETU
  232. ENDC
  233. ENDD
  234. RETU....................'