Procedural dialog programming steps

Follow this procedure to use the DIAOG instruction.

To implement a procedural 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. With the DEFINE instruction, declare program variables (records and arrays) that will be used as data models. 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.
  3. Open and display the form, using the OPEN WINDOW WITH FORM clause or the OPEN FORM / DISPLAY FORM instructions.
  4. Fill the program variables (the model) with data. For lists, you typically use a result set cursor.
  5. Implement the DIALOG instruction 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).
    1. Inside each sub-dialog instruction, define the behavior with control blocks such as BEFORE DIALOG, AFTER ROW, BEFORE FIELD, and interaction blocks such as ON ACTION.
    2. To end the DIALOG instruction, implement an ON ACTION close or ON ACTION accept / ON ACTION cancel to handle dialog validation and cancellation, with the ACCEPT DIALOG and EXIT DIALOG control instructions. The INT_FLAG variable will not be set as in singular dialogs.