OSQL MENU Command

PURPOSE: This command 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 in the USE clause.  Each menu is a self-contained Process Module which uses the SMF window development language and is invoked with the OSQL USE command.  If the DEFINE PM clause is included, then the Process Module created to execute the OSQL command will be saved in the current DBL under the object name specified.

Syntax

OSQL MENU menu_title_str
[HORIZONTAL; VERTICAL]
\\ITEM item_title_str {USE {CM; PM; SF} object_name
[INCLUDE include_list] 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), Process Module (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 ACCENT R name up to 40 characters in length.

It is 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.  DCL command procedures or 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.

INCLUDE include_list

includes code from a Code Segment (CS) into a particular section/location within the OSQL generated process module.

DEFINE PM menu_title_MENU

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

ONLY

specifies that the Process Module 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 this item already exists, OSQL will notify the designer that this is an error condition.

Examples

*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 &
   ITEM DEFINE PM ORDERS_MENU ONLY
*OSQL USE PM ORDERS_MENU

OSQL Menu Command

Figure 16 OSQL MENU Command

NOTES:  The MENU command requires that each menu you define have 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.  However, clearing specific GS’s is allowable with the USE NO GS gs_name command.

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

OSQL Insert Command    OSQL Select Command