Procedural dialog programming steps
Follow this procedure to use the DIAOG instruction.
To implement a procedural 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
DIALOGblocks). -
With the
DEFINEinstruction, declare program variables (records and arrays) that will be used as data models. For record lists (DISPLAY ARRAYorINPUT 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. -
Open and display the form, using
OPEN WINDOW WITH FORMor theOPEN FORM/DISPLAY FORMinstructions. - Fill the program variables (the model) with data. For lists, you typically use a result set cursor.
-
Implement the
DIALOGinstruction block to handle interaction. Define each sub-dialog with program variables to be used as data models. The sub-dialogs will define how variables will be used (display or input).-
Inside each sub-dialog instruction, define the behavior with control blocks such as
BEFORE DIALOG,AFTER ROW,BEFORE FIELD, and interaction blocks such asON ACTION. -
To end the
DIALOGinstruction, implement anON ACTION closeorON ACTION accept/ON ACTION cancelto handle dialog validation and cancellation, with theACCEPT DIALOGandEXIT DIALOGcontrol instructions. TheINT_FLAGvariable will not be set as in singular dialogs.
-
Inside each sub-dialog instruction, define the behavior with control blocks such as