home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol110 / main.cmd < prev    next >
Encoding:
Text File  |  1984-04-29  |  3.0 KB  |  126 lines

  1. * main.cmd 02/09/83
  2. * main command program of database
  3. * this is a dBASEII database we use in a number of applications
  4. * it has been adopted to a sample ACGNJ database, and you can
  5. * modify it further to suit your particular application. note that
  6. * the link files has not yet been included in the menu structure.
  7. * also note that we have not implemented all of the features
  8. * we contemplate, so that some program features are not yet
  9. * available. lastly, the starting point on this program was
  10. * Adam Green 's "dBASE II User' s guide " published by Software
  11. * Bank, 1 Faneuil Hall Marketplace, Boston, MA 02109. We highly 
  12. * recommend that book as the best thing around to get started in
  13. * dBASEii and suggest you may even want to start off with
  14. * a Software Bank seminar.
  15. *
  16. *
  17. * this program runs well under both cp/m and cp/m 86. to run
  18. * under cp/m 86 just change the name of this files to main.prg.
  19. * one known bug, if you edit on the duprec format you
  20. * will not see the changes until second viewing. We
  21. * think it relates to too many memory variables.
  22.  
  23. * comments, suggestions and improvements are welcome.
  24. *                                                    
  25. * Send to:
  26. * Steve Leon
  27. * Department of Law
  28. * 48th floor
  29. * 2 World Trade Center
  30. * New York, NY 10047
  31. * (212)488-7677
  32. * or (201) 886-1658
  33. * display sign-on message while initializing system
  34. DO sign-ON.acg
  35.  
  36. * initialize variables, set up environment, use files, etc.
  37. DO init.acg
  38.  
  39. * set up the loop
  40. DO WHILE t
  41.   
  42.   * set up screen and prompts
  43.   SET FORMAT TO SAY-rec
  44.   STORE '<F>orward, <B>ackward, <D>elete/Recall, <H>elp' TO prompt1
  45.   STORE '<S>earch, <E>dit, <P>rint, <R>eports, <M>aintenance' TO prompt2
  46.   STORE '<A>dd or <Q>uit to CP/M' TO prompt3
  47.   STORE 'Main Menu ' TO mode
  48.   STORE '?' TO command
  49.   
  50.   * find out if the current record is marked for deletion
  51.   *  DO delcheck.acg 
  52.    IF *
  53.       STORE 'Deleted' TO deleted
  54.    ELSE
  55.       STORE ' ' TO deleted
  56.    ENDIF * 
  57.   
  58.   
  59.   * show the current record, and find out what to do next
  60.   STORE ' ' TO send
  61.   READ
  62.   
  63.   
  64.   * perform selected function
  65.   DO CASE
  66.       
  67.     CASE command = 'A' 
  68.       DO ADD.acg
  69.       
  70.     CASE (command = 'B' .OR. command = ',' )
  71.       * move backwards one record
  72.       SKIP -1
  73.       
  74.     CASE command = 'D' 
  75.       * switch the current record from deleted to recalled
  76.       * DO DELETE.acg
  77.  
  78.       IF *
  79.          RECALL
  80.       ELSE
  81.          DELETE
  82.       ENDIF * 
  83.  
  84.     CASE command = 'E' 
  85.       STORE # TO recordno
  86.       SET INDEX to
  87.       GOTO recordno
  88.       RELEASE recordno
  89.       RECALL 
  90.       DO EDIT.acg
  91.       
  92.     CASE (command = 'F' .OR. command = '.' )
  93.       * move forward one record
  94.       SKIP
  95.       
  96.     CASE command = 'H' 
  97.       DO help.acg
  98.       
  99.     CASE command = 'M' 
  100.       DO maintain.acg
  101.       
  102.     CASE command = 'P' 
  103.       DO PRINT.acg
  104.       
  105.     CASE command = 'Q' 
  106.       * prevent sign-off message
  107.           SET console OFF
  108.       ERASE
  109.       QUIT
  110.       
  111.       
  112.     CASE command = 'R' 
  113.       DO REPORT.acg
  114.       
  115.     CASE command = 'S' 
  116.       DO search.acg
  117.       
  118.       
  119.   ENDCASE 
  120.   
  121.   * loop back again
  122. ENDDO WHILE t 
  123.  
  124.  
  125.