Chapter Contents

Previous

Next
The PMENU Procedure

ITEM Statement


Identifies an item to be listed in a menu bar or in a pull-down menu.

Featured in: Building a Menu Bar for an FSEDIT Application


ITEM command <option(s)><action-options>;
ITEM 'menu-item' <option(s)><action-options>;

To do this Use this option
Specify the action for the item

Associate the item with a dialog box DIALOG=

Associate the item with a pull-down menu MENU=

Associate the item with a command SELECTION=

Associate the item with a common submenu SUBMENU=
Specify help text for an item HELP=
Define a key that can be used instead of the pull-down menu ACCELERATE=
Indicate that the item is not an active choice in the window GRAY
Provide an ID number for an item ID=
Define a single character that can select the item MNEMONIC=
Place a check box or a radio button next to an item STATE=


Required Arguments

command
a single word that is a valid SAS command for the window in which the menu appears. Commands that are more than one word, such as WHERE CLEAR, must be in single quotes. The command appears in uppercase letters on the menu bar.

If you want to control the casing of a SAS command on the menu, enclose the command in single quotes and the case that you used then appears on the menu.

menu-item
a word or text string, enclosed in quotes, that describes the action that occurs when the user selects this item. A menu item should not begin with a percent sign (%).


Options

ACCELERATE=name-of-key
defines a key sequence that can be used instead of selecting an item. When the user presses the key sequence, it has the same effect as selecting the item from the menu bar or pull-down menu.
Restriction: The functionality of this option is limited to only a few characters. For details, see the SAS documentation for your operating environment.
Restriction: This option is not available in all operating environments. If you include this option and it is not available in your operating environment, the option is ignored.

action-option
is one of the following:

DIALOG=dialog-box
the name of an associated DIALOG statement, which displays a dialog box when the user selects this item.
Featured in: Creating a Dialog Box to Search Multiple Variables

MENU=pull-down-menu
the name of an associated MENU statement, which displays a pull-down menu when the user selects this item.
Featured in: Building a Menu Bar for an FSEDIT Application

SELECTION=selection
the name of an associated SELECTION statement, which submits a command when the user selects this item.
Featured in: Building a Menu Bar for an FSEDIT Application

SUBMENU=submenu
the name of an associated SUBMENU statement, which displays a pmenu entry when the user selects this item.
Featured in: Building a Menu Bar for an FSEDIT Application

If no DIALOG=, MENU=, SELECTION=, or SUBMENU= option is specified, the command or menu-item text string is submitted as a command-line command when the user selects the item.

GRAY
indicates that the item is not an active choice in this window. This option is useful when you want to define standard lists of items for many windows, but not all items are valid in all windows. When this option is set and the user selects the item, no action occurs.

HELP='help-text'
specifies text that is displayed when the user displays the menu item. For example, if you use a mouse to pull down a menu, hold the mouse button on the item and the text is displayed.
Restriction: This option is not available in all operating environments. If you include this option and it is not available in your operating environment, the option is ignored.
Tip: The place where the text is displayed is operating environment-specific.

ID=integer
a value that is used as an identifier for an item in a pull-down menu. This identifier is used within a SAS/AF application to selectively gray or ungray items in a menu or to set the state of an item as a check box or a radio button.
Minimum: 3001
Restriction: Integers from 0 - 3000 are reserved for operating environment and SAS System use.
Restriction: This option is not available in all operating environments. If you include this option and it is not available in your operating environment, the option is ignored.
Tip: ID= is useful with the WINFO function in SAS Screen Control Language.
Tip: You can use the same ID for more than one item.
See also: STATE= option

MNEMONIC=character
underlines the first occurrence of character in the text string that appears on the pull-down menu. The character must be in the text string.

The character is typically used in combination with another key, such as ALT. When you use the key sequence, it has the same effect as putting your cursor on the item. But it does not invoke the action that the item controls.
Restriction: This option is not available in all operating environments. If you include this option and it is not available in your operating environment, the option is ignored.

STATE=CHECK|RADIO
provides the ability to place a check box or a radio button next to an item that has been selected.
Tip: STATE= is used with the ID= option and the WINFO function in SAS Screen Control Language.
Restriction: This option is not available in all operating environments. If you include this option and it is not available in your operating environment, the option is ignored.


Defining Items on the Menu Bar
You must use ITEM statements to name all the items that appear in a menu bar. You also use the ITEM statement to name the items that appear in any pull-down menus. The items that you specify in the ITEM statement can be commands that are issued when the user selects the item, or they can be descriptions of other actions that are performed by associated DIALOG, MENU, SELECTION, or SUBMENU statements.

All ITEM statements for a menu must be placed immediately after the MENU statement and before any DIALOG, SELECTION, SUBMENU, or other MENU statements. In some operating environments, you can insert SEPARATOR statements between ITEM statements to produce lines separating groups of items in a pull-down menu. See SEPARATOR Statement for more information.

CAUTION:
If you specify a menu bar that is too long for the window, it might be truncated or wrapped to multiple lines.  [cautionend]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.