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
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 parentDIALOG
block, and passed as parameter to the sub-dialog with theSUBDIALOG
instruction. -
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).-
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
-
Reference the declarative dialog with the
SUBDIALOG
clause in a proceduralDIALOG
block.