Menus in TAE are defined in menu definition files (MDF); one MDF corresponds to one menu. To add a menu to the system, it is only necessary to create an MDF--using the host system's text editor--and to link it into the menu tree. (Unlinked menus can also be accessed by using the "MENU name" command.)
An MDF contains:
An MDF is linked into the menu tree when the menu name is referenced in an entry of another MDF.
A sample MDF is shown in Figure 4-1; the associated menu is shown in Figure 4-2.
! MDF FOR TESTS ! ! Note that the exclamation point may be used in ! an MDF to denote commentary (which does not ! appear on the menu display). .TITLE TAE Test Programs .MENU CMDTESTS Menu for command procedure testing .PROC XPTEST General test of parameter pickup .PROC PRMDMP General parameter block dumper .PROC ARITH Program to do arithmetic on two numbers .PROC WAIT A program to wait for user-specified intervals .COMMAND TUTOR VGEN OUTFILE=standard.img Image file pattern generator exerciser with primed OUTFILE .PROC PARMGEX Parameter passing self tester .COMMAND DISPLAY $MENUS Display current menu stack. ! ! MENU HELP ! .HELP This menu consists of test, diagnostic, and demonstration programs for TAE. The first selection is a menu entry for additional procs which are command procedures for testing TCL control structures. .END |
The general form of an MDF is:
.TITLE header text line(s) .PROC or .MENU or .COMMAND entry text lines .PROC or .MENU or .COMMAND entry text lines . . . .HELP help text .END
The capitalized words beginning with a period are menu definition directives, described below.
The definition directives consist of a directive to specify the title of the menu (.TITLE), directives to specify help text (.HELP, .EHELP, and .PAGE), and directives to specify the actual menu entries that appear on the menu screen (.PROC, .MENU, and .COMMAND). Entries on the screen are numbered by TAE according to the order in which the .PROC, .MENU, and .COMMAND directives appear in the MDF.
The .TITLE directive introduces the text lines to be used in the menu title; if .TITLE is present, it must be the first directive. Any number of lines may follow .TITLE and these lines are displayed exactly as they appear in the MDF. The maximum number of characters in any .TITLE text line is 80; characters beyond column 80 are ignored.
.TITLE is not required.
The .PROC directive defines a menu entry for a proc; the text that follows the .PROC line is the text that is to appear for the corresponding entry number. The .PROC directive contains the file specification of the PDF that is accessed if the user selects the corresponding menu entry. (See Section 2 for details on PDFs.)
When the user selects a .PROC menu entry, TAE enters tutor mode for the proc.
If the file specification does not include a proc library name, then the PDF is located according to the standard library hierarchy search as described in Section 2.13. The maximum number of characters in any PROC text line is 76; characters beyond column 76 are ignored.
The .MENU directive creates a screen entry to refer to another menu; the text lines that follow the .MENU line are the text lines that are to appear for the corresponding entry number. The .MENU directive contains the specification of the MDF that is to be activated if the user selects the corresponding entry. If the library of the MDF is not specified, then TAE uses the hierarchy search (Section 2.13) to locate the MDF.
The maximum number of characters in any MENU text line is 76; characters beyond column 76 are ignored.
Because one menu may reference another menu, the root menu defines a "menu tree." A menu tree may have a maximum of 50 levels of menus. The root menu is, by default, the MDF in the TAE system menu library and is named ROOT. A user may select a root menu different from the default by referencing the menu from the ULOGON procedure as described in Section 2.14.
The .COMMAND directive specifies a TCL command to be executed if the user selects the corresponding menu entry. The command may be any TCL command and the TCL line continuation convention (+) may be used to continue the command string from the initial .COMMAND directive; the ".COMMAND" directive is not repeated on continued lines.
The .EHELP directive specifies help text for a .COMMAND entry. The .EHELP directive and associated text must follow the .COMMAND directive and its associated text.
The .HELP directive introduces lines of free-form text that are displayed when the menu user types "HELP *". These lines are treated identically to those in a .HELP paragraph in a help file. (See Section 2.15.)
The .PAGE directive is used within help text to force a new screen page.
Lines in an MDF beginning with an exclamation point are considered comments and are ignored by the menu processor.
The .COMMAND directive is a generalization of the .MENU and .PROC directives.
With .COMMAND, an MDF author has considerable flexibility. For example, whereas a .PROC entry always starts in tutor mode, .COMMAND may execute a proc directly, supplying proc parameters in the .COMMAND directive. Programmers are cautioned to use .COMMAND carefully, because users are often confused by the inconsistency that some menu entries start in tutor and some entries do not. The following is an MDF that demonstrates some .COMMAND techniques:
.TITLE This menu demonstrates .COMMAND techniques. .COMMAND LET $SWITCH = 1 Set the TAE switch word so that programs start in the debugger. .COMMAND DCL SHOW TIME Display time of day. .COMMAND DISPLAY $MENUS Display current menu stack. .COMMAND RADCOR IMAGE=STANDARD WINDOW=(0,511,0,511) Execute the RADCOR proc with the standard image and for the upper left side of the screen. .COMMAND TUTOR RADCOR |RUN=BATCH| Tutor on RADCOR. The tutor RUN will execute RADCOR in batch mode. .COMMAND RADCOR |RESTORE=RADCOR| Execute RADCOR using parameters from the most recent tutor SAVE.
Menu and help displays may be made sensitive to the current run-time session. See Section 2.15.3.
The Terminal Monitor processes a menu definition file as follows:
A menu must fit on one screen. If the entries exceed the screen limit, TAE displays only the entries that fit, ignoring the remaining entries.
Because MDFs are located via the hierarchy search (Section 2.13), a user has a "personalized menu tree" if an MDF named ROOT exists in the user's directory. MDF references from this root directory may exist in the user's directory, in application libraries, or in the system menu library.
The -SUBMIT subcommand of the TAE BATCH and TAE ASYNC proc exists so that a menu user may submit a batch or asynchronous job. The procedure to submit a job from menu mode is:
There are features available in TAE to capture a user in menu mode and prevent entry to the operating system. The MENU-CLOSED TCL command puts the user in menu mode, while instructing TAE to prevent re-entry to command mode. See the "TAE Command Language (TCL) User's Manual" and the "TAE Plus System Manager's Guide" for details of captive menu.