menus Definition/General, menus Definition/General

menus

Command menus Definition/General
Applicable release versions: AP
Category General (155)
Description provide a selection of processing choices.

Menus are items in the master dictionary (md). 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 verb.

The format of the menu item in the md 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"
is the master dictionay code identifying this item as a menu.

"comments"
are 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"
is the 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'"
is the description of menu choice 'n' as it is to appear on the menu. The text is displayed with a leading "n) " before it, where 'n' is the option number the user is to choose. The menu processor will automatically insert the appropriate option number.

"help 'n'"
is the 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 is displayed as the "help" information. Otherwise no help text is displayed. The help text is processed through the Output processor before being displayed. Embedded OP commands may be used to format the help text as necessary.

"statement 'n'"
is a 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 Pick/BASIC 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 is displayed (centered and in reverse video) on top, and the menu options are displayed in columns (TERM width permitting) with a preceeding choice number. At the bottom, it will display "Enter number of choice, number? for help, <Enter> to exit menu, or verb:".

To select a choice, enter the option number, press <Enter>, and the associated statement(s) will be performed. After the statement(s) are performed, the process will display a message "Hit any key to return to the menu ". Pressing <Enter> re-displays the menu, and it will wait for another choice.

To invoke "help", enter the option number and a "?", and press <Enter>. The help text for this option (if any) will display. If there is no help text for this option, but the statement to be executed is a macro or a menu, the processor will read the item, and scan its first line for comments and display them as the help text (if any). Entering a "?" without any option number will display the "menu comments" as if it were help text.

To exit the menu, press <Enter>.

While in the menu, an Access statement or TCL command may be entered. The system will push a level and perform the command. After the command is performed, the process will display a message "Hit any key to return to the menu ". Pressing <Enter> re-displays the menu, and it will wait for another choice.
Syntax
Options
Example
Purpose
Related tcl.introduction
tcl.lm
account

menus

Command menus Definition/General
Applicable release versions: AP
Category General (155)
Description provide a selection of processing choices.

Menus are items in the master dictionary (md). 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 verb.

The format of the menu item in the md 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"
is the master dictionay code identifying this item as a menu.

"comments"
are 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"
is the 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'"
is the description of menu choice 'n' as it is to appear on the menu. The text is displayed with a leading "n) " before it, where 'n' is the option number the user is to choose. The menu processor will automatically insert the appropriate option number.

"help 'n'"
is the 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 is displayed as the "help" information. Otherwise no help text is displayed. The help text is processed through the Output processor before being displayed. Embedded OP commands may be used to format the help text as necessary.

"statement 'n'"
is a 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 Pick/BASIC 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 is displayed (centered and in reverse video) on top, and the menu options are displayed in columns (TERM width permitting) with a preceeding choice number. At the bottom, it will display "Enter number of choice, number? for help, <Enter> to exit menu, or verb:".

To select a choice, enter the option number, press <Enter>, and the associated statement(s) will be performed. After the statement(s) are performed, the process will display a message "Hit any key to return to the menu ". Pressing <Enter> re-displays the menu, and it will wait for another choice.

To invoke "help", enter the option number and a "?", and press <Enter>. The help text for this option (if any) will display. If there is no help text for this option, but the statement to be executed is a macro or a menu, the processor will read the item, and scan its first line for comments and display them as the help text (if any). Entering a "?" without any option number will display the "menu comments" as if it were help text.

To exit the menu, press <Enter>.

While in the menu, an Access statement or TCL command may be entered. The system will push a level and perform the command. After the command is performed, the process will display a message "Hit any key to return to the menu ". Pressing <Enter> re-displays the menu, and it will wait for another choice.
Syntax
Options
Example
Purpose
Related tcl.introduction
tcl.lm
account