What are dialog controllers?

Application forms are controlled by interactive instruction blocks called dialogs. These blocks perform the common tasks associated with the form, such as field input and action handling.

The interactive instructions allow the program to respond to user actions and data input.

Simple display (non-interactive)

Instructions such as DISPLAY BY NAME display program variable data in the fields of a form and continue the program flow without giving control to the end user. This is in fact not an interactive instruction, as it just displays data to the current form, and returns immediately. However, it may be used in interactive instructions to display information to the end user.
Note: When using the UNBUFFERED mode of a dialog, you do not need to use the DISPLAY BY NAME instruction to synchronize program variables and form fields.

The MESSAGE and ERROR instructions are also simple display instructions without user interaction. These instructions are typically used to display a warning message to the end user.

Modal dialogs and parallel dialogs

Interactive instructions can be implemented as modal or parallel dialogs. Modal dialogs control a given window, and that window closes when the dialog is accepted or canceled. The window displays on top of any existing windows which are not accessible while the modal dialog executes. Parallel dialogs allow access to several windows simultaneously; the user can switch from one window to the other. Parallel dialogs are mainly used to implement split views on mobile platforms.

The interactive dialog blocks

The singular MENU instruction handles a list of choices to activate a specific function of the program. No field input is possible with this instruction. The user can only select an action from the list.

The singular INPUT instruction is designed for simple record input. It enables the fields in a form for input, waits while the user types data into the fields, and proceeds after the user accepts or cancels the dialog.

The singular DISPLAY ARRAY instruction is used to browse a list of records. It allows the user to view the contents of a program array of records, scrolling the record list on the screen and choosing a specific record. DISPLAY ARRAY implements by default a read-only list of records, but can be extended to become a modifiable list with list modification triggers such as ON INSERT.

The singular INPUT ARRAY instruction supports record list input. It allows the user to alter the contents of records of a program array, and to insert and delete records.

The singular CONSTRUCT instruction is designed to let the user enter search criteria for a database query. The user can enter a value or a range of values for one or several form fields, and your program looks up the database rows that satisfy the requirements.

The procedural DIALOG instruction (placed in the program flow) allows you to combine several INPUT, DISPLAY ARRAY, INPUT ARRAY and CONSTRUCT functionality within the same form.

The declarative DIALOG block (defined in a module at the same level as a function) allows you to implement individual MENU, INPUT, DISPLAY ARRAY, INPUT ARRAY and CONSTRUCT functionality, that will perform in parallel on several forms, when used with the START DIALOG and TERMINATE DIALOG instructions. Declarative DIALOG blocks can also be associated with a procedural DIALOG instruction through the SUBDIALOG clause, it will then act as a procedural DIALOG sub-dialog. See also Using declarative dialogs.

Dynamic dialogs

When the form structure and field definitions can only be determined at runtime, it is possible to implement Dynamic Dialogs, using generic code that will control a form generated on the fly.

Dynamic dialogs can implement all types of dialogs like static dialogs do. However, this feature should only be used in specific cases where regular static dialog instructions cannot be used. Static dialog code is more readable than generic code implementing dynamic dialogs. A generic record selection from a list (zoom) is the perfect candidate for a dynamic dialog.