8.7 Format of a Menufile

The overall format of a menufile is:

menufile [ name ] [, BUILT_IN_COMMANDS=toggle]

menufile command (optional)

menufile command (optional)

.

.

.

menu description

menu description (optional)

.

.

.

parameter description (optional)

parameter description (optional)

.

.

.

The menufile statement is required and can optionally be used to name the menufile. Name is a name for the menufile. It may be up to fifteen characters long. All menufiles created by menudef are given the name Untitled.

In addition, the menufile statement can designate whether built-in menu commands are to be enabled or disabled by including BUILT_IN_COMMANDS=toggle. If toggle is ON, built-in menu commands are enabled; if toggle is OFF, built-in menu commands are disabled.

If menufile commands appear after the menufile line, they must start with a blank or tab character, and are executed when menu is first started, i.e., before the first menu is displayed.

A menu description defines one menu screen and the commands to execute when a choice is selected. The format of a menu description is:

menu menuname

menu command (optional)

menu command (optional)

.

.

.

row, col text (optional background text)

.

.

.

row, col text (choice)

choice command

choice command

.

.

.

Menuname is a name, from 1 to 15 characters, that labels the following menu definition. If menu commands appear after the menu line, they must start with a blank or tab character. Menu executes the menu commands each time the menu is entered before displaying the menu.

The remainder of a menu description consists of background text and choices. Background text and choices can be interspersed within a menu description. Background text and choices both display text at a specific location on the screen. The operator may select the choice to execute the choice commands, while background text only displays text on the screen.

The row and col attributes are the starting row and column positions of where menu displays the text. The value for row and col may be a number (5), a plus followed by a number (+2), or a minus followed by a number (-2). The last two forms add or subtract the specified number to the value of row or col from the previous defined location of a choice prompt or background text. Row 1, column 1 is the upper left corner of the screen. The text is displayed at the specified row and column. This text can be any sequence of characters. Any blanks or tabs between the column and the text are ignored.

A parameter form is a form displayed on the screen to allow input into parameter fields. The value read for each parameter field is assigned to a menu variable and must match the data type specified for the parameter field.

The format of a parameter form is:

param paramname

row, col text (optional background text)

.

.

.

row, col varname (parameter field definition)

DATATYPE=datatype

FIELDSIZE=size

[REQUIRED]

.

.

.

Parameter specifies the name of the parameter form that is accessible in any menu in the menufile. The remainder of a parameter form is a series of parameter field definitions and background text. Parameter field definitions and background text can be interspersed within a parameter form description.

A parameter field definition defines the menu variable name and location of the field on a parameter form, as well as a description of the parameter field.

The screen location of background text and parameter fields are defined in the same format as background text and choices for a menu. The row and col attributes are the starting row and column positions of where menu displays the text. The value for row and col may be a number (5), a plus followed by a number (+2), or a minus followed by a number (-1). The last two forms add or subtract the specified number to the value of row or col from the previous location of a parameter field or background text.

Varname is the name of the variable. Varname may consist of 1 to 15 characters. The first character must be a letter, and the rest may be letters or digits.

The description of the parameter field begins on the following line and must start with a blank (or tab) character. The ordering for the description of the parameter field is arbitrary. Datatype identifies the type of information that can be stored in a parameter field. Datatype can be boolean, character, date, integer, long, money, real, string, or time. For a description of these data types, see section 8.6.7.2, Edit Data Type Field.

Size specifies the length in characters of the parameter field on the parameter form. The optional REQUIRED attribute specifies that the field on the parameter form requires input. Omitting this attribute specifies that the parameter variable does not require input.