Declarative dialog programming steps

This procedure describes how to implement a declarative DIALOG block.

To implement a declarative DIALOG block:

  1. Create a form specification file containing screen record(s) and/or screen array(s). The screen records and screen arrays identify the presentation elements to be used by the runtime system to display the data models (the content of program variables bound to the DIALOG blocks).
  2. Create a dedicated .4gl module to implement the declarative DIALOG block.
  3. With the TYPE instruction, declare a user-defined type (records or arrays). for variables that will be used as data models by the sub-dialog. These variables can be defined locally in the module implementing the sub-dialog, or they can be defined in the module implementing the parent DIALOG block, and passed as parameter to the sub-dialog with the SUBDIALOG instruction.
  4. Define the declarative DIALOG block in the module, to handle interaction. Define a sub-dialog with local or parameter variables to be used as data models. The sub-dialog will define how variables will be used (display or input).
    1. Inside the sub-dialog instruction, define the behavior with control blocks such as BEFORE ROW, AFTER ROW, BEFORE FIELD, and interaction blocks such as ON ACTION.
  5. Reference the declarative dialog with the SUBDIALOG clause in a procedural DIALOG block.