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 DEFINE instruction, declare program variables (records and arrays) that will be used as data models. These will typically be defined as PRIVATE module variables. For record lists (DISPLAY ARRAY or INPUT ARRAY), the members of the program array must correspond to the elements of the screen array, by number and data types. To handle record lists, use dynamic arrays instead of static arrays.
  4. Define the declarative DIALOG block in the module, to handle interaction. Define a sub-dialog with program 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.