OSQL Menu

PURPOSE:  OSQL MENU creates either a horizontally or vertically oriented menu for application prototyping.  Menus can be linked together by specifying the name of a DEFINEd Process Module (PM) in the USE clause.  Each menu is a self-contained PM which uses the Screen Management Facility (SMF) window development language.  If the DEFINE PM clause is included, then the PM created to execute the OSQL command will be saved in the current Data Base Library (DBL) under the object name specified.

SYNTAX

OSQL MENU menu_title_str [HORIZONTAL; VERTICAL]

\\ITEM item_title_str {USE {CM; PM; SF} object_name DO command_str}\\

[DEFINE PM menu_name_MENU [ONLY]]

menu_title_str

is the name of the menu which will be presented on the screen to the user.  Menu_title_str may be up to 120 characters in length.  This parameter may be enclosed with quote marks.  Otherwise, ACCENT R syntax rules will be applied as normal.

[HORIZONTAL; VERTICAL]

specifies the orientation of the menu in either horizontal or vertical styles.  VERTICAL menus will allow up to 20 items to be displayed in a central location on the screen.  HORIZONTAL menus will allow several items to be displayed at a central location at the top of the screen.  This clause is optional.  If no orientation of the menu is specified, then OSQL MENU will assume that a vertically oriented menu is desired by the designer.

ITEM item_title_str

is the name of item as it will be displayed to the user of the menu.  Up to 20 menu items may be specified on a vertical menu.  The item_title_str may be up to 120 characters in length.  This parameter may be enclosed with quote marks.  Otherwise, ACCENT R syntax rules will be applied as normal.

USE {CM; PM; SF} object_name

specifies the object type and object name that is to be invoked upon selection of the menu item.  Any Command Module (CM), PM, or System File (SF) may be specified.  This keyword must accompany the ITEM clause for each menu item.  The object_name parameter must be a valid object_name up to 40 characters in length.

It's not necessary that the items exist when they are specified in the menu.

DO command_str

can be any valid ACCENT R command.  Note that any embedded quoted string must be enclosed in single quote marks.  The command_str may be up to 120 characters in length.  Digital Command Language (DCL) command procedures or 3rd Generation Language (3GL) programs can be executed with the DO command in conjunction with the SPAWN command.  This parameter may be enclosed with quote marks.  Otherwise, ACCENT R syntax rules will be applied as normal.

DEFINE PM

menu_name_MENU

specifies that the PM containing the code generated to execute the OSQL command be saved and named as an object  in the current DBL.  This PM is made up of ACCENT R SPL and SMF statements and is useful for prototyping applications.  The PM name may be up to 40 characters in length and must be a valid PM name for the OSQL Menu Router (see Note below).

ONLY

specifies that the PM will be created without being executed by OSQL.  This clause is used primarily by the OSQL BUILD command but may also be used for on-line prototyping.  If the ONLY clause is included, the PM may be invoked interactively or from a CM.

If this item already exists, OSQL will notify the designer that this is an error condition.

EXAMPLE

*OSQL MENU Orders_Menu &
ITEM Add an Order USE PM ORDER_SCREEN &
ITEM Merge an Order USE PM MERGE_PROCESS &
ITEM Print an Order USE CM PRINT_ORDER_FORM &
DEFINE PM ORDERS_MENU ONLY
*OSQL USE PM ORDERS_MENU

NOTES:  The MENU command requires that each menu defined has the word 'MENU' as the trailing part of the name.  Adherence to this naming convention will allow the OSQL Menu Router to properly chain from menu to menu as well as to and from each menu selection.

If you do not include the menu selection "Return", OSQL MENU will include it automatically.

Applications executed with OSQL USE must not invoke the USE NO GS command.  Otherwise, the communication area for the OSQL MENU command will be erased.

The PM created by the OSQL MENU command must be invoked with OSQL USE in order to run in the OSQL environment.