home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / MISC / SMSTR32C.ZIP / SM09.DOC < prev    next >
Encoding:
Text File  |  1991-01-21  |  18.0 KB  |  361 lines

  1.  
  2.      -------------------------------------------------------------------------
  3.      SECTION 9   Menu Design & Construction
  4.      -------------------------------------------------------------------------
  5.  
  6.      9.1   Menu Design
  7.  
  8.            When designing a menuing system you should aim for a System which
  9.            operates with the greatest ease and with the maximum of function-
  10.            ality and flexibility.  It is with this goal in mind that we will
  11.            proceed with this phase of the documentation.
  12.  
  13.            There are 2 ways in which to proceed from this point:
  14.                1)  All-In-1 Approach
  15.                2)  Modular Approach
  16.  
  17.            We will be discussing a file copying menu option throughout this
  18.            section.  I will cover some of the processing possibilities of
  19.            each approach.
  20.  
  21.            9.1.1   The All-In-1 Approach
  22.  
  23.                    The All-In-1 Approach involves including all of the com-
  24.                    mands required to define a menu option into 1 menu option.
  25.                    The All-In-1 approach is by far the most straight forward
  26.                    method, but is not necessarily the most efficient.
  27.  
  28.            9.1.2   The Modular Approach
  29.  
  30.                    The Modular Approach involves the selective breaking up of
  31.                    command sets into 'modular', reuseable command segments
  32.                    that can be [I]ncluded into other menu options.  At some
  33.                    point it may become necessary for you to utilize this
  34.                    method, if your command sets become too large.  SYSTEM
  35.                    MASTER's ability to process sub-command sets, puts it above
  36.                    other 'menu systems' available today.
  37.  
  38.                    By utilizing the '[I]' SYSTEM MASTER Include command it is
  39.                    very simple to create sub-command menu options, and call
  40.                    them into another option at run-time.
  41.  
  42.                    9.1.2.1   Determining When to Utilize the Modular Approach
  43.  
  44.                              There are no hard and fast rules for you to follow
  45.                              on this subject.  There are, although a few guide-
  46.                              lines that will assist you in choosing when either
  47.                              may be appropriate.
  48.  
  49.                              1)  If the proposed command set will require more
  50.                                  than 255 characters to define (Add 1 char to
  51.                                  each command line for determining its ultimate
  52.                                  length).
  53.  
  54.                              2)  If the proposed command set has a multitude of
  55.                                  configurations, it may be wise not to repeat a
  56.                                  lot of command sets redundantly, as any minor
  57.  
  58.      Release Date: 21 January, 1991
  59.      -------------------------------------------------------------------------
  60.      System Master 3.2                                              Page  9- 1
  61.  
  62.      -------------------------------------------------------------------------
  63.      SECTION 9   Menu Design & Construction
  64.      -------------------------------------------------------------------------
  65.  
  66.                                  revision to a processing method may cause a
  67.                                  mountain of menu updating.
  68.  
  69.            In the Menu Construction discussion, we will cover both methods of
  70.            menu design and then you will have the ultimate decision of utiliz-
  71.            ing the method which best suits your requirements.
  72.  
  73.      9.2   Menu Construction
  74.  
  75.            The Menu Construction phase, involves the determination of the
  76.            design method which best serves the purpose of the menu option
  77.            being coded.  Either of the 2 design approaches can be used any-
  78.            where in SYSTEM MASTER.  It is left up to your best judgement to
  79.            use these options efficiently.  After the purpose of the menu
  80.            option has been determined, and the best processing method has
  81.            been decided upon, it is time to jump in and begin defining the
  82.            commands for the menu option.
  83.  
  84.            9.2.1    All-in-1 Approach
  85.  
  86.                     The All-in-1 Approach means that all commands required to
  87.                     perform a specific system task are located and defined
  88.                     within a single menu option.
  89.  
  90.                     9.2.1.1   Defining Menu Options
  91.  
  92.                               The Definition of menu options is by far the most
  93.                               difficult for me to explain to anyone.  Because
  94.                               of the virtually infinite ways in which commands
  95.                               are used, and data is manipulated, there is no
  96.                               correct way to define the menu options within
  97.                               SYSTEM MASTER.  We will, however, give you our
  98.                               input as to the way the SYSTEM MASTER tool could
  99.                               be utilized.
  100.  
  101.                               9.2.1.1.1   A Simple File Copying Option
  102.  
  103.                                           The Following Command set is a very
  104.                                           basic command for copying file(s).
  105.                                           When executed, you would be promp-
  106.                                           ted for the name of a source file,
  107.                                           and for the name for the target file.
  108.                                           No Error Handling is implemented.
  109.                                           After the copying operation has been
  110.                                           completed, SYSTEM MASTER would be
  111.                                           reloaded and the selection bar re-
  112.                                           turned to the Directory option
  113.                                           without any verification that the
  114.                                           copy operation was successful.
  115.  
  116.  
  117.  
  118.      Release Date: 21 January, 1991
  119.      -------------------------------------------------------------------------
  120.      System Master 3.2                                              Page  9- 2
  121.  
  122.      -------------------------------------------------------------------------
  123.      SECTION 9   Menu Design & Construction
  124.      -------------------------------------------------------------------------
  125.  
  126.  
  127.                           ------------ COPY FILE(S) Sample #1
  128.                          |         [W]
  129.                          |         [!]
  130.                          |         [!] *** COPY FILE(S) ***
  131.             * see menu option      [!]
  132.             * 011101 for this      [?] S Enter Name of Source File:
  133.             * command segment      [!]
  134.             * in operation...      [?] S Enter Name for Target File:
  135.                          |         copy %1 %2
  136.                          |         [L] C
  137.                           ------------ End of Sample...
  138.  
  139.                               9.2.1.1.2   An Advanced File Copying Option
  140.  
  141.                                           The Following Command set example is
  142.                                           a bit more sophisticated than the
  143.                                           example found in 9.1.1.1.  When exe-
  144.                                           cuted, you would be prompted for the
  145.                                           name of a source file, and for the
  146.                                           name for the target file.  If the
  147.                                           Source file did not exist, or if the
  148.                                           Target file did exist, the batch file
  149.                                           would terminate, without an error
  150.                                           message being displayed, otherwise
  151.                                           the copy operation would continue.
  152.                                           If the copy operation was unsuccess-
  153.                                           ful, the batch file would terminate,
  154.                                           without an error message being
  155.                                           displayed.
  156.  
  157.                           ------------ COPY FILE(S) Sample #2
  158.                          |         [W]
  159.                          |         [!]
  160.                          |         [!] *** COPY FILE(S) ***
  161.             * see menu option      [!]
  162.             * 011102 for this      [?] S Enter Name of Source File:
  163.             * command segment      [!]
  164.             * in operation...      [?] S Enter Name for Target File:
  165.                          |         if NOT exist %1 goto EXITBAT
  166.                          |         if exist %2 goto EXITBAT
  167.                          |         copy %1 %2
  168.                          |         :EXITBAT
  169.                          |         cls
  170.                          |         [L] C
  171.                           ------------ End of Sample...
  172.  
  173.  
  174.  
  175.  
  176.      Release Date: 21 January, 1991
  177.      -------------------------------------------------------------------------
  178.      System Master 3.2                                              Page  9- 3
  179.  
  180.      -------------------------------------------------------------------------
  181.      SECTION 9   Menu Design & Construction
  182.      -------------------------------------------------------------------------
  183.  
  184.            9.2.2    Modular Approach
  185.  
  186.                     The Modular Approach means that commands required to
  187.                     perform a specific system task are broken into functional
  188.                     tasks and located and defined throughout the system.
  189.  
  190.                     9.2.2.1   Defining Menu Options
  191.  
  192.                               The Definition of menu options is by far the most
  193.                               difficult for me to explain to anyone.  Because
  194.                               of the virtually infinite ways in which commands
  195.                               are used, and data is manipulated, there is no
  196.                               correct way to define the menu options within
  197.                               SYSTEM MASTER.  We will, however, give you our
  198.                               input as to the way the SYSTEM MASTER tool could
  199.                               be utilized.
  200.  
  201.                               9.2.2.1.1   A More Advanced Copying Option
  202.  
  203.                                           The Following Command set is one that
  204.                                           builds on the 2 samples provided in
  205.                                           section 9.2.1.1.  Although similar,
  206.                                           we are now going to implement error
  207.                                           detection and handling routines.
  208.  
  209.                                           The Following Command set example is
  210.                                           a lot more sophisticated than the
  211.                                           examples found in 9.2.1.1.  When exe-
  212.                                           cuted, you would be prompted for the
  213.                                           name of a source file, and for the
  214.                                           name for the target file.  If the
  215.                                           Source file did not exist, or if the
  216.                                           Target file did exist, a message
  217.                                           would be displayed and the batch file
  218.                                           would terminate, otherwise the copy
  219.                                           operation would continue.  If the
  220.                                           copy operation was unsuccessful, an
  221.                                           error message would be displayed and
  222.                                           the batch file would terminate.
  223.  
  224.                                           The Copy Operation Example #3 uses
  225.                                           the SYSTEM MASTER '[I]' Include
  226.                                           instruction and utilizes the modular
  227.                                           design approach.
  228.  
  229.                                           This Operation uses 5 menu cells to
  230.                                           define the necessary commands: The
  231.                                           first is the menu option call, and
  232.                                           the remaining 4 cells describe the
  233.                                           error handling procedures.
  234.  
  235.  
  236.      Release Date: 21 January, 1991
  237.      -------------------------------------------------------------------------
  238.      System Master 3.2                                              Page  9- 4
  239.  
  240.      -------------------------------------------------------------------------
  241.      SECTION 9   Menu Design & Construction
  242.      -------------------------------------------------------------------------
  243.  
  244.              ***  The Cell Coordinates (6 digit integer string (i.e. 011103)),
  245.                   attached to each of the command definition segments, below,
  246.                   indicate the cell location within the sample menu, provided
  247.                   with SYSTEM MASTER, where the physical command sets are
  248.                   defined.
  249.  
  250.                            ------------ COPY FILE(S) Sample #3
  251.                           |         [W]
  252.                           |         [!]
  253.                           |         [!] *** COPY FILE(S) ***
  254.              * see menu option      [!]
  255.              * 011103 for this      [?] S Enter Name of Source File:
  256.              * command segment      [!]
  257.              * in operation...      [?] S Enter Name for Target File:
  258.                           |         if NOT exist %1 goto NOSRC
  259.                           |         if exist %2 goto ISTAR
  260.                           |         copy %1 %2
  261.                           |         if NOT exist %2 goto NOTAR
  262.                           |         [I] 989502
  263.                           |         [I] 989503
  264.                           |         [I] 989504
  265.                           |         [I] 989505
  266.                            ------------ End of example...
  267.  
  268.                            ----------- Include Option
  269.                           |        :NOSRC
  270.                       989502       echo Source File Does NOT EXIST...
  271.                           |        echo Can NOT Continue Processing!!!
  272.                           |        goto EXITBAT
  273.                            ------
  274.  
  275.                            ----------- Include Option
  276.                           |        :ISTAR
  277.                       989503       echo Target File Already EXISTS...
  278.                           |        echo This File Must be REPLACEd!!!
  279.                           |        goto EXITBAT
  280.                            ------
  281.  
  282.                            ----------- Include Option
  283.                           |        :NOTAR
  284.                       989504       echo Target File Does NOT EXIST...
  285.                           |        echo Operation was Unsuccessful!!!
  286.                           |        goto EXITBAT
  287.                            ------
  288.  
  289.                            ----------- Include Option
  290.                           |        :EXITBAT
  291.                       989505       PAUSE Press Any Key to Continue...
  292.                           |        cls
  293.                           |        [L] C
  294.                            ------
  295.  
  296.  
  297.  
  298.      Release Date: 21 January, 1991
  299.      -------------------------------------------------------------------------
  300.      System Master 3.2                                              Page  9- 5
  301.  
  302.      -------------------------------------------------------------------------
  303.      SECTION 9   Menu Design & Construction
  304.      -------------------------------------------------------------------------
  305.  
  306.                   In the above example, as the command set is processed,
  307.                   each of the commands is interpreted by SYSTEM MASTER and
  308.                   the appropriate actions are taken.  When the command pro-
  309.                   cessor reads an [I] Include command, the menu cell,
  310.                   specified by the 6 digit integer string is loaded from
  311.                   the appropriate menu definition file, and its contents
  312.                   are placed within the selected menu option's command set.
  313.  
  314.                   If the file 'SOURCE.FIL' was the response to the prompt
  315.                   for the source file, and 'TARGET.FIL' was the response
  316.                   for the target file, the following batch commands would be
  317.                   written to a temporary file and executed:
  318.  
  319.                          if NOT EXIST SOURCE.FIL goto NOSRC
  320.                          if EXIST TARGET.FIL goto ISTAR
  321.                          copy SOURCE.FIL TARGET.FIL
  322.                          if NOT EXIST TARGET.FIL goto NOTAR
  323.                          :NOSRC
  324.                          echo Source File Does NOT Exist...
  325.                          echo Can NOT Continue Processing!!!
  326.                          goto EXITBAT
  327.                          :ISTAR
  328.                          echo Target File Already EXISTS...
  329.                          echo This File Must be REPLACEd!!!
  330.                          goto EXITBAT
  331.                          :NOTAR
  332.                          echo Target File does NOT EXIST...
  333.                          echo Operation was Unsuccessful!!!
  334.                          goto EXITBAT
  335.                          :EXITBAT
  336.                          PAUSE Press any key to Continue...
  337.                          cls
  338.                          SML 011103
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.      By utilizing the SYSTEM MASTER commands in conjunction with DOS & Batch
  346.      commands, the flexibility of SYSTEM MASTER is virtually limitless.
  347.  
  348.      When defining menu options, always weigh all of your configuration
  349.      options carefully.  Doing so will almost ensure the results you are
  350.      seeking.
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.      Release Date: 21 January, 1991
  359.      -------------------------------------------------------------------------
  360.      System Master 3.2                                              Page  9- 6
  361.