home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol155 / sammenu.doc < prev    next >
Encoding:
Text File  |  1984-04-29  |  14.4 KB  |  238 lines

  1. *SAMMENU-Sampel Menu Program.*****(NON-EXECUTABLE ANNOTATED COPY)********************************
  2. *DATE OF LAST UPDATE  05/17/83                                                                  *
  3. *REVISION NUMBER 001.00                                                                         *
  4. *                                                *
  5. *                           THIS PROGRAM PLACED INTO PUBLIC DOMAIN BY                           *
  6. *                           DOUGLAS G. COUSE, ATLANTA, GA. 5/20/83                              *
  7. *                           COPYING FOR NON-COMMMERCIAL OR EDUCATIONAL                          *
  8. *                           PURPOSES ALLOWED, PROVIDED THIS NOTICE IS                           *
  9. *                           NOT REMOVED.  COMMERCIAL RESALE IS PROHIBITED.                      *
  10. *                                                                                               *
  11. *    This command file provides for access and execution of SAM001.CMD & SAM002.CMD.            *
  12. *    This command file is the only entry point or exit point from the application.              *
  13. *                                                *
  14. *    NOTES:-------------------------------------------------------------                        *
  15. *                                                                        *
  16. *          1. All explanatory comments are enclosed in boxes, indented                          *
  17. *             and immediately precede the section of programming code                           *
  18. *             to which they refer.                                                              *
  19. *-----------------------------------------------------------------------------------------------*
  20. *     DATABASE & OTHER FILE UTILIZATION STATISTICS                            *
  21. *                                                *
  22. *    Database file: NONE                                                                     *
  23. *    Index file:    NONE                                               *
  24. *    Memory file:   NONE                                    *
  25. *       Other files:   SAMSCRM.CMD This is a command file which contains the screen image used  *
  26. *                                  by this program and is called from the program initialization*
  27. *                                  section P-020.                                               *
  28. *                                                                                               *
  29. *                      SAM001.CMD  This is the DATA ENTRY  PROGRAM command file and is called   *
  30. *                                  into execution from section P-040 at the user's request.     *
  31. *                                                                                               *
  32. *                      SAM002.CMD  This is the MAINTENANCE PROGRAM command file and is called   *
  33. *                                  into execution from section P-040 at the user's request.     *
  34. *                                                *
  35. *       --------------------------------------------------------------------------------------- *
  36. *                                                                                               *
  37. *    NON-COMPLEMENTARY MEMORY VARIABLE UTILIZATION STATISTICS                                *
  38. *                                                                                               *
  39. *    Variables Used:_____________________________________________________________________    *
  40. *    |    | Memory     |    |    |                                                      |    *
  41. *    |    | Variable   |    |    |                                                      |    *
  42. *     | No.| Name       |Type|Size|                     Description                      |    *
  43. *    |----|------------|----|----|------------------------------------------------------|    *
  44. *    |    |            |    |    |                                                      |    *
  45. *    |  1 | PREFIX     | C  | 3  | This variable is initialized with the literal value  |    *
  46. *    |    |            |    |    | "SAM"to provide the front end of a concatinated      |    *
  47. *    |    |            |    |    | variable PROGRAM which is used to define the program |    *
  48. *    |    |            |    |    | to be executed.                                      |    *
  49. *    |    |            |    |    |                                                      |    *
  50. *    |  2 | SUFFIX     | N  | 2  | This variable is used to accept the number of the    |    *
  51. *    |    |            |    |    | program selected by the user, this variable is       |    *
  52. *    |    |            |    |    | combined with PREFIX and moved to PROGRAM in building|    *
  53. *    |    |            |    |    | the name of the program to be executed.              |    *
  54. *    |    |            |    |    |                                                      |    *
  55. *    |  3 | PROGRAM    | C  | 6  | This is the variable which is built by the process   |    *
  56. *    |    |            |    |    | of concatinating PREFIX and SUFFIX.                  |    *
  57. *    |    |            |    |    |                                                      |    *
  58. *    |  4 | MORE       | C  | 1  | This variable is used to enter and exit a doloop. It |    *
  59. *    |    |            |    |    | is the primary doloop variable of this command file  |    *
  60. *    |    |            |    |    | and uses the literal "T" to enter the doloop and the |    *
  61. *    |    |            |    |    | literal "F" to exit the doloop. This variable is     |    *
  62. *    |    |            |    |    | associated with a doloop which will remain in effect |    *
  63. *    |    |            |    |    | while all sub-ordinate programs are executed.        |    *
  64. *    |    |            |    |    |                                                      |    *
  65. *       ------------------------------------------------------------------------------------    *
  66. *                                                                                               *
  67. *       MESSAGE UTILIZATION STATISTICS                                                          *
  68. *       ____________________________________________________________________________________    *
  69. *       |        |                                                                         |    *
  70. *       | TYPE   |  MESSAGE CONTENTS                                                       |    *
  71. *       |--------|-------------------------------------------------------------------------|    *
  72. *       |        |                                                                         |    *
  73. *       | PROMPT | Enter selection ## or strike <RETURN> to END                            |    *
  74. *       |        |                                                                         |    *
  75. *       | ERROR  | Invalid option, strike any key to repeat                                |    *
  76. *       |        |                                                                         |    *
  77. *       ------------------------------------------------------------------------------------    *
  78. *************************************************************************************************
  79.  
  80.             **************************************************************************************************
  81.                         *NOTE----any comment labelled (*P-) is a procedural section numbering reference                  *
  82.             *that should be used in flowcharting and other program documentation.                            *
  83.             **************************************************************************************************
  84.  
  85.  
  86. *P-001-{START}. Program and screen initialization.
  87.  
  88.             **************************************************************************************************
  89.             * This section is a standardized program initialization section which: 1. disables screen dialog;*
  90.             * 2. refreshes the screen; 3. refreshes memory; 4. closes any open database files; 5. provides a * 
  91.             * fresh work area for dbase.                                                                     *
  92.             **************************************************************************************************
  93.  
  94. ERASE
  95. SET ECHO OFF
  96. SET TALK OFF
  97. CLEAR
  98. RELEASE
  99. USE
  100. *P-001-{END}.
  101.  
  102. =================================================================================
  103.  
  104. *P-005-{START}.  Doloop (initialization and execution) section.
  105. STORE "T" TO MORE
  106. DO WHILE MORE = "T"
  107. *P-005-{END}.
  108.  
  109. =================================================================================
  110.  
  111. *P-010-{START}. Link variable initialization SECTION.
  112.  
  113.             **************************************************************************************************
  114.             *Initialization of the first program name building variable.                                     *
  115.             **************************************************************************************************
  116.     
  117. STORE "SAM" TO PREFIX
  118. *P-010-{END}.
  119.  
  120. =================================================================================
  121.  
  122. *P-020-{START}. Screen literal display program call & execution section.
  123. DO SAMSCRM
  124. *P-020-{END}.
  125.  
  126. =================================================================================
  127.  
  128. *P-030-{START}. Option message display and option entry/validation section.
  129.  
  130.             **************************************************************************************************
  131.             *Initialization of the second program name building variable.                                    *
  132.             **************************************************************************************************
  133.     
  134. STORE 00 TO SUFFIX
  135.  
  136.             **************************************************************************************************
  137.             *screen intensity is toggled off and on to provide for the display of all screen images except   *
  138.             *option selection list at HIGH INTENSITY.                                                        *
  139.             **************************************************************************************************
  140.    
  141. SET INTENSITY OFF
  142.  
  143.             **************************************************************************************************
  144.             *Display of selection PROMPT MESSAGE.                                                            *
  145.             *Conditional check to determine if the user has entered a program option #                       *
  146.             *or hit the <RETURN> key.  A <RETURN> only entry will force the doloop                           *
  147.             *variable to be set to a value of "F" which will terminate the doloop                            *
  148.             *thus forcing and end of program execution.                                                      *
  149.             **************************************************************************************************
  150.     
  151. @ 21,05 SAY 'Enter selection ## or strike <RETURN> to END ' GET SUFFIX PICTURE '99'
  152. READ
  153. SET INTENSITY ON
  154. IF SUFFIX = 00
  155.     STORE "F" TO MORE
  156.     LOOP 
  157. ELSE
  158.  
  159.             **************************************************************************************************
  160.             *if a program option is selected, it will be examined to determine if the value entered is       *
  161.             *greater than 2.  This will cause an error message to be displayed and the doloop will be        *
  162.             *re-executed.                                                                                    *
  163.             *the console toggling is done to inhibit the display of the auto message                         *
  164.             *WAITING whenever the wait command is executed. The wait command is                              *
  165.             *used so that the REMARK message can be observed by the user before re-execution                 *
  166.             *of the doloop.                                                                                  *
  167.             **************************************************************************************************
  168.     
  169.     IF SUFFIX >2  
  170.         SET INTENSITY OFF
  171.         @ 22,1 SAY "-"
  172.         REMARK Invalid option, strike any key to repeat
  173.         SET INTENSITY ON
  174.         SET CONSOLE OFF
  175.         WAIT
  176.         SET CONSOLE ON
  177.         ERASE
  178.         LOOP         
  179.     ENDIF 2
  180. ENDIF 1
  181. *P-030-{END}.
  182.  
  183. =================================================================================
  184.  
  185. *P-040-{START}. Program link variable generation & execution section.
  186.  
  187.             **************************************************************************************************
  188.             *The 2 program name building variables are concatinated                                          *
  189.             *                                                                                                *
  190.             *These 2 variables are then removed from memory to insure                                        *
  191.             *that sufficient memory variable space is available for the variables generated                  *
  192.             *and used by the entry and maintenance programs.                                                 *
  193.             *                                                                                                *
  194.             *The concatinated program name is then used to call the desired program and execute same.        *
  195.             **************************************************************************************************
  196.     
  197. STORE PREFIX+"00"+STR(SUFFIX,1) TO PROGRAM
  198. RELEASE PREFIX
  199. RELEASE SUFFIX
  200. DO &PROGRAM 
  201. *P-040-{END}.
  202.  
  203. =================================================================================
  204.  
  205. *P-050-{START}. Re-entry point after called program has been exited.
  206.  
  207.             **************************************************************************************************
  208.             *After the called program has completed execution, processing will return to this point in the   *                                                                                             *
  209.             *menu program.  The primary doloop variable will be re-initialized and program flow will return  *
  210.             *to the top of the doloop.                                                                       *
  211.             **************************************************************************************************
  212.     
  213. STORE "T" TO MORE
  214. LOOP
  215. *P-050-{END}.
  216.  
  217. =================================================================================
  218.  
  219. *P-060-{START}. End of program execution and exit to operating system.
  220.  
  221.             **************************************************************************************************
  222.             *primary doloop terminiation point.                                                              * 
  223.             **************************************************************************************************
  224.  
  225. ENDDO
  226.  
  227.             **************************************************************************************************
  228.             *program exit and housekeeping,ie. re-toggling of screen processing                              *
  229.             *switches, clearing of memory, clearing of screen                                                *
  230.             **************************************************************************************************
  231.  
  232. ERASE
  233. RELEASE
  234. CLEAR
  235. USE
  236. QUIT
  237. *P-060-{END}.
  238.