Creating menus

NMENU organizational commands and options

Organizational commands establish the content and organization of the menus the user sees on the screen. Use these commands to determine what the menus look like.

The following list gives an overview of the organizational commands. Detailed information about each command follows the list.

MENU
Marks the beginning of a new menu or submenu screen in the text.

ITEM
Identifies an item to be listed on the menu. Specifies execution parameters.

MENU

The MENU command indicates a new window definition within your menu file. It has the following command format:

MENU menu_number,menu_name

Replace menu_number with the number you want to assign to this menu. Menus are called and displayed by their number.

A menu number can be any number from 1 through 255. Each menu within a source file must be assigned a unique number, but the number sequence does not matter.

Replace menu_name with the title you want to appear at the top of the menu. Menu names can be a maximum of 40 characters long.

The first menu defined in the source file is always the first menu displayed, no matter what number is assigned to it. Subsequent menus are referenced by their numbers, no matter what order they appear in the .SRC file.

For example, if you have defined three menus and assigned them numbers 1, 2, and 5, and menu 5 is the first menu in the source file, menu 5 is displayed first. Menus 1 and 2 are referenced in control commands and displayed depending upon user selection.

For example, to define a main menu for a program to be used by accountants in your company, type a line similar to the following:

   MENU 1,Accounting Main Menu
Since this is the first menu you want to appear, place it at the beginning of your menu program.

ITEM

The ITEM command indicates an option in the menu. It has the following command format:

ITEM item_name {[option...]}

Replace item_name with the list item you want to appear in the menu. The maximum length for an item is 40 characters.

Replace option with one or more of the options shown in the following list. Separate multiple options with a space. Enclose all options for a single ITEM within a single set of braces.

These options provide you with better control of menu execution. You determine how memory is used, which directory the user remains in, and what information is presented to those users.

BATCH
Removes the menu program from memory before executing the item.

Without this option, a portion of the memory stays resident, requiring approximately 32KB of available memory, even though an application may be running.

For example, if you type ITEM Word 5.0 {BATCH}, the menu program is removed from memory when Word 5.0 is executed.

Setting this option automatically sets the CHDIR option. Do not use this command with the EXEC DOS command; use EXEC CALL.

For more information, see ``EXEC''.

CHDIR
Changes back to the drive and directory that were in effect before an ITEM was executed.

For example, to change back to the drive and directory the user was in before executing a word- processing application in another directory, type ITEM Word 5.0 {CHDIR}.

When the word-processing application is closed, the directory is changed to the original directory for the menu.

PAUSE
Allows users to read messages associated with a command being executed from the menu by pausing the screen display.

The message Press any key to continue is also displayed, and the screen does not change until a user presses a key.

For example, to display a message when a user selects the item ``DOS Copy'' from the menu, include this line:

ITEM DOS Copy {PAUSE}

When the copy function is complete, the display waits at the Press any key... prompt for a key to be pressed before returning to the menu.

SHOW
Displays the command name, such as COPY or DIR, in the upper left corner of the screen.

For example, if you type ITEM Copy Files {SHOW}, the DOS command COPY is displayed when the item is executed.

List items appear on the menu in the same order as they appear in the source file. They are not displayed in alphabetical order.

Each item is automatically assigned an alphabetic selection character.

If you want to assign a different character, place a carat (^) and the character you want in front of the item name (no spaces).


NOTE: Forcing the selection character shortens the maximum line length to 38 characters.

If you assign any selection letters, you should assign a letter to all menu list items. Otherwise an item may be automatically assigned a letter you assigned previously.

For example, if the first menu item is ``Word Processing'' and you want to assign it the letter ``W'' instead of the automatic letter designation of ``A'',type

ITEM ^WWord Processing


© 1999 The Santa Cruz Operation, Inc. All rights reserved.
UnixWare 7 Release 7.1.1 - 5 November 1999