home *** CD-ROM | disk | FTP | other *** search
-
- -------------------------------------------------------------------------
- SECTION 9 Menu Design & Construction
- -------------------------------------------------------------------------
-
- 9.1 Menu Design
-
- When designing a menuing system you should aim for a System which
- operates with the greatest ease and with the maximum of function-
- ality and flexibility. It is with this goal in mind that we will
- proceed with this phase of the documentation.
-
- There are 2 ways in which to proceed from this point:
- 1) All-In-1 Approach
- 2) Modular Approach
-
- We will be discussing a file copying menu option throughout this
- section. I will cover some of the processing possibilities of
- each approach.
-
- 9.1.1 The All-In-1 Approach
-
- The All-In-1 Approach involves including all of the com-
- mands required to define a menu option into 1 menu option.
- The All-In-1 approach is by far the most straight forward
- method, but is not necessarily the most efficient.
-
- 9.1.2 The Modular Approach
-
- The Modular Approach involves the selective breaking up of
- command sets into 'modular', reuseable command segments
- that can be [I]ncluded into other menu options. At some
- point it may become necessary for you to utilize this
- method, if your command sets become too large. SYSTEM
- MASTER's ability to process sub-command sets, puts it above
- other 'menu systems' available today.
-
- By utilizing the '[I]' SYSTEM MASTER Include command it is
- very simple to create sub-command menu options, and call
- them into another option at run-time.
-
- 9.1.2.1 Determining When to Utilize the Modular Approach
-
- There are no hard and fast rules for you to follow
- on this subject. There are, although a few guide-
- lines that will assist you in choosing when either
- may be appropriate.
-
- 1) If the proposed command set will require more
- than 255 characters to define (Add 1 char to
- each command line for determining its ultimate
- length).
-
- 2) If the proposed command set has a multitude of
- configurations, it may be wise not to repeat a
- lot of command sets redundantly, as any minor
-
- Release Date: 21 January, 1991
- -------------------------------------------------------------------------
- System Master 3.2 Page 9- 1
-
- -------------------------------------------------------------------------
- SECTION 9 Menu Design & Construction
- -------------------------------------------------------------------------
-
- revision to a processing method may cause a
- mountain of menu updating.
-
- In the Menu Construction discussion, we will cover both methods of
- menu design and then you will have the ultimate decision of utiliz-
- ing the method which best suits your requirements.
-
- 9.2 Menu Construction
-
- The Menu Construction phase, involves the determination of the
- design method which best serves the purpose of the menu option
- being coded. Either of the 2 design approaches can be used any-
- where in SYSTEM MASTER. It is left up to your best judgement to
- use these options efficiently. After the purpose of the menu
- option has been determined, and the best processing method has
- been decided upon, it is time to jump in and begin defining the
- commands for the menu option.
-
- 9.2.1 All-in-1 Approach
-
- The All-in-1 Approach means that all commands required to
- perform a specific system task are located and defined
- within a single menu option.
-
- 9.2.1.1 Defining Menu Options
-
- The Definition of menu options is by far the most
- difficult for me to explain to anyone. Because
- of the virtually infinite ways in which commands
- are used, and data is manipulated, there is no
- correct way to define the menu options within
- SYSTEM MASTER. We will, however, give you our
- input as to the way the SYSTEM MASTER tool could
- be utilized.
-
- 9.2.1.1.1 A Simple File Copying Option
-
- The Following Command set is a very
- basic command for copying file(s).
- When executed, you would be promp-
- ted for the name of a source file,
- and for the name for the target file.
- No Error Handling is implemented.
- After the copying operation has been
- completed, SYSTEM MASTER would be
- reloaded and the selection bar re-
- turned to the Directory option
- without any verification that the
- copy operation was successful.
-
-
-
- Release Date: 21 January, 1991
- -------------------------------------------------------------------------
- System Master 3.2 Page 9- 2
-
- -------------------------------------------------------------------------
- SECTION 9 Menu Design & Construction
- -------------------------------------------------------------------------
-
-
- ------------ COPY FILE(S) Sample #1
- | [W]
- | [!]
- | [!] *** COPY FILE(S) ***
- * see menu option [!]
- * 011101 for this [?] S Enter Name of Source File:
- * command segment [!]
- * in operation... [?] S Enter Name for Target File:
- | copy %1 %2
- | [L] C
- ------------ End of Sample...
-
- 9.2.1.1.2 An Advanced File Copying Option
-
- The Following Command set example is
- a bit more sophisticated than the
- example found in 9.1.1.1. When exe-
- cuted, you would be prompted for the
- name of a source file, and for the
- name for the target file. If the
- Source file did not exist, or if the
- Target file did exist, the batch file
- would terminate, without an error
- message being displayed, otherwise
- the copy operation would continue.
- If the copy operation was unsuccess-
- ful, the batch file would terminate,
- without an error message being
- displayed.
-
- ------------ COPY FILE(S) Sample #2
- | [W]
- | [!]
- | [!] *** COPY FILE(S) ***
- * see menu option [!]
- * 011102 for this [?] S Enter Name of Source File:
- * command segment [!]
- * in operation... [?] S Enter Name for Target File:
- | if NOT exist %1 goto EXITBAT
- | if exist %2 goto EXITBAT
- | copy %1 %2
- | :EXITBAT
- | cls
- | [L] C
- ------------ End of Sample...
-
-
-
-
- Release Date: 21 January, 1991
- -------------------------------------------------------------------------
- System Master 3.2 Page 9- 3
-
- -------------------------------------------------------------------------
- SECTION 9 Menu Design & Construction
- -------------------------------------------------------------------------
-
- 9.2.2 Modular Approach
-
- The Modular Approach means that commands required to
- perform a specific system task are broken into functional
- tasks and located and defined throughout the system.
-
- 9.2.2.1 Defining Menu Options
-
- The Definition of menu options is by far the most
- difficult for me to explain to anyone. Because
- of the virtually infinite ways in which commands
- are used, and data is manipulated, there is no
- correct way to define the menu options within
- SYSTEM MASTER. We will, however, give you our
- input as to the way the SYSTEM MASTER tool could
- be utilized.
-
- 9.2.2.1.1 A More Advanced Copying Option
-
- The Following Command set is one that
- builds on the 2 samples provided in
- section 9.2.1.1. Although similar,
- we are now going to implement error
- detection and handling routines.
-
- The Following Command set example is
- a lot more sophisticated than the
- examples found in 9.2.1.1. When exe-
- cuted, you would be prompted for the
- name of a source file, and for the
- name for the target file. If the
- Source file did not exist, or if the
- Target file did exist, a message
- would be displayed and the batch file
- would terminate, otherwise the copy
- operation would continue. If the
- copy operation was unsuccessful, an
- error message would be displayed and
- the batch file would terminate.
-
- The Copy Operation Example #3 uses
- the SYSTEM MASTER '[I]' Include
- instruction and utilizes the modular
- design approach.
-
- This Operation uses 5 menu cells to
- define the necessary commands: The
- first is the menu option call, and
- the remaining 4 cells describe the
- error handling procedures.
-
-
- Release Date: 21 January, 1991
- -------------------------------------------------------------------------
- System Master 3.2 Page 9- 4
-
- -------------------------------------------------------------------------
- SECTION 9 Menu Design & Construction
- -------------------------------------------------------------------------
-
- *** The Cell Coordinates (6 digit integer string (i.e. 011103)),
- attached to each of the command definition segments, below,
- indicate the cell location within the sample menu, provided
- with SYSTEM MASTER, where the physical command sets are
- defined.
-
- ------------ COPY FILE(S) Sample #3
- | [W]
- | [!]
- | [!] *** COPY FILE(S) ***
- * see menu option [!]
- * 011103 for this [?] S Enter Name of Source File:
- * command segment [!]
- * in operation... [?] S Enter Name for Target File:
- | if NOT exist %1 goto NOSRC
- | if exist %2 goto ISTAR
- | copy %1 %2
- | if NOT exist %2 goto NOTAR
- | [I] 989502
- | [I] 989503
- | [I] 989504
- | [I] 989505
- ------------ End of example...
-
- ----------- Include Option
- | :NOSRC
- 989502 echo Source File Does NOT EXIST...
- | echo Can NOT Continue Processing!!!
- | goto EXITBAT
- ------
-
- ----------- Include Option
- | :ISTAR
- 989503 echo Target File Already EXISTS...
- | echo This File Must be REPLACEd!!!
- | goto EXITBAT
- ------
-
- ----------- Include Option
- | :NOTAR
- 989504 echo Target File Does NOT EXIST...
- | echo Operation was Unsuccessful!!!
- | goto EXITBAT
- ------
-
- ----------- Include Option
- | :EXITBAT
- 989505 PAUSE Press Any Key to Continue...
- | cls
- | [L] C
- ------
-
-
-
- Release Date: 21 January, 1991
- -------------------------------------------------------------------------
- System Master 3.2 Page 9- 5
-
- -------------------------------------------------------------------------
- SECTION 9 Menu Design & Construction
- -------------------------------------------------------------------------
-
- In the above example, as the command set is processed,
- each of the commands is interpreted by SYSTEM MASTER and
- the appropriate actions are taken. When the command pro-
- cessor reads an [I] Include command, the menu cell,
- specified by the 6 digit integer string is loaded from
- the appropriate menu definition file, and its contents
- are placed within the selected menu option's command set.
-
- If the file 'SOURCE.FIL' was the response to the prompt
- for the source file, and 'TARGET.FIL' was the response
- for the target file, the following batch commands would be
- written to a temporary file and executed:
-
- if NOT EXIST SOURCE.FIL goto NOSRC
- if EXIST TARGET.FIL goto ISTAR
- copy SOURCE.FIL TARGET.FIL
- if NOT EXIST TARGET.FIL goto NOTAR
- :NOSRC
- echo Source File Does NOT Exist...
- echo Can NOT Continue Processing!!!
- goto EXITBAT
- :ISTAR
- echo Target File Already EXISTS...
- echo This File Must be REPLACEd!!!
- goto EXITBAT
- :NOTAR
- echo Target File does NOT EXIST...
- echo Operation was Unsuccessful!!!
- goto EXITBAT
- :EXITBAT
- PAUSE Press any key to Continue...
- cls
- SML 011103
-
-
-
-
-
-
- By utilizing the SYSTEM MASTER commands in conjunction with DOS & Batch
- commands, the flexibility of SYSTEM MASTER is virtually limitless.
-
- When defining menu options, always weigh all of your configuration
- options carefully. Doing so will almost ensure the results you are
- seeking.
-
-
-
-
-
-
-
- Release Date: 21 January, 1991
- -------------------------------------------------------------------------
- System Master 3.2 Page 9- 6