Consider the following simple dialog box:
// dialog1.pan
@dialog
A Simple Dialog Box
Generate Function < >~< >(100,.01)~<GRANDOM><GNORMAL>
<L>
~menuclear
The dialog box appears as:

Statements at the top of the menu file include comments (lines that begin with // or !), lines that begin with special @ functions that indicate how the menu file is processed (e.g., positioning, type, formatting), lines enclosed by curly braces {} that are evaluated when the menu is invoked, and lines of text for the menu title and display. Following this section is the main body of the menu file. The main body of the menu file tells what to display to the user when the menu is invoked, as well as what types of input are required. In a dialog box, there are three components on each line separated by a tilde (~). These components are referred to as the display area, the expression area, and the input area.
1 |
|
2 |
|
3 |
Generate Function<> |
~ |
<> (100, .1) |
~ |
<GRANDOM><GNORMAL> |
Display area |
|
Expression area |
|
input area |
The
display area, from the left
margin to the first tilde (~) character, specifies the type of control
that appears to the user when the menu is invoked. The display
area can contain a pair of braces
Generate Function < >~< >(100,.01)~<GRANDOM><GNORMAL>
The
expression area is the group
of commands and text between the two tildes on each line. This
is where the expression that gets passed to DADiSP is stored. This
section is created dynamically and contains the user’s choice from
the third section. Here it is not important how many spaces you have
between the angle brackets
Generate Function < >~< >(100,.01)~<GRANDOM><GNORMAL>
The input area is the text and commands to the right of the second tilde (~). This is where the user’s input choices are made. DADiSP evaluates the input area expression when the user selects the line by clicking on the list box or the field in the dialog box. In many menus, the INPUT function serves as the input vehicle. In other menus, the user can choose from a list box. The input area of dialog1.pan is highlighted here:
Generate Function < >~< >(100,.01)~<GRANDOM><GNORMAL>
The last line or lines of the menu file that begin with a tilde (~) character contain commands to be processed by DADiSP after the OK button and expression area commands are executed. These are called the end execution statements. The end execution statement for this example is:
~menuclear
The execution statement area of dialog1.pan includes the special formatting statement <L> that displays a line between the body of the dialog box and the automatic OK Cancel buttons. Formatting lines can be used to clarify the presentation of a dialog box.