Declarative dialog programming steps
This procedure describes how to implement a declarative DIALOG
block.
To implement a declarative DIALOG
block:
-
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). -
Create a dedicated .4gl module to implement the
declarative
DIALOG
block. -
With the
DEFINE
instruction, declare program variables (records and arrays) that will be used as data models. These will typically be defined asPRIVATE
module variables. For record lists (DISPLAY ARRAY
orINPUT 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. -
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).-
Inside the sub-dialog instruction, define the behavior with control blocks such as
BEFORE ROW
,AFTER ROW
,BEFORE FIELD
, and interaction blocks such asON ACTION
.
-
Inside the sub-dialog instruction, define the behavior with control blocks such as
-
A declarative dialog can be used as
SUBDIALOG
in a proceduralDIALOG
block, or as parallel dialog with theSTART DIALOG
/TERMINATE DIALOG
instructions.