Menus provide a selection of processing choices.
Menus are items in the master dictionary. The menu processor automatically formats on the screen and prompts for one of the menu options.
A help facility displays any text associated with that menu option when a question mark is included with the option number.
The menu is invoked by entering its item-ID at TCL, as if it were a TCL command.
The format of the menu item in the master dictionary is:
001 |
me {comments} |
002 |
title |
003 |
option 1 |
help 1 |
|
statement 1 |
|
004 |
option 2 |
help 2 |
|
statement 2.1 |
|
statement 2.2 |
|
. |
|
005 option 3 . . . . . |
me |
Master dictionary code identifying this item as a menu. |
comments |
Optional text used to document the menu. The comments only serve to document the menu and are never output during menu processing. At least one space must separate the comments from the me. |
title |
Text displayed when the menu is activated. The text is centered and displayed in reverse video, so leading and trailing spaces are significant. |
option n |
Description of menu choice n as it displays on the menu. The text displays with a leading n) before it, where n is the option number the user is to choose. The menu processor automatically inserts the appropriate option number. |
help n |
Text to be displayed when help is requested. To request help, enter the number of the option for which help is desired, followed or preceded by a question mark (?). If the optional help text is missing and is requested, the menu processor scans the TCL statement to determine if it invokes a macro or menu. The first line of a menu displays as the help information. Otherwise no help text displays. The help text is processed through the Output Processor before being displayed. Embedded Output Processor commands can be used to format the help text as necessary. |
statement n |
List of one or more TCL statements to be executed when this menu option is selected. This can be any statement that can be entered at TCL, including another menu name, or a FlashBASIC program. Multiple TCL statements are separated by value marks. |
A menu is invoked by entering the menu’s name (or item-ID) at TCL.
The menu title displays (centered and in reverse video) on top, and the menu options are displayed in columns (TERM width permitting) with a preceding choice number. The prompt below displays at the bottom of the screen:
Enter number of choice, number? for help, <Enter> to exit menu, or command: |
To select a choice, enter the option number, press ENTER, and the associated statements are performed, after which, the process displays:
Hit any key to return to the menu. |
Pressing ENTER redisplays the menu, and it waits for another choice.
To invoke help, enter the option number and a ?, and press ENTER. The help text for this option (if any) displays. If there is no help text for this option, but the statement to be executed is a macro or a menu, the processor reads the item, and scans its first line for comments and displays them as the help text (if any). Entering a ? without any option number displays the menu comments as if it were help text.
To exit the menu, press ENTER.
While in the menu, an AQL statement or TCL command can be entered. The system pushes a level and performs the command. After the command is performed, the process displays the message:
Hit any key to return to the menu. |
Pressing ENTER redisplays the menu, and it waits for another choice.
WARNING |
Any TCL commands entered from the menu prompt are not kept in the user’s TCL-stack. The menu display (in columns) may seem arbitrary, especially if the menu is executed from both 80-column terminals and 132-column terminals. Appending spaces to the trailing end of the option description value forces the menu processor to reduce the number of columns in the menu display. |
See Also