DIALOG programming steps

The following steps describe how to use the DIALOG statement:

  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 (i.e. the content of program variables bound to the DIALOG instruction).
  2. With the DEFINE instruction, declare program variables (i.e. 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 a the OPEN WINDOW WITH FORM clause or the OPEN FORM / DISPLAY FORM instructions.
  4. Fill the program variables 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).
  6. Inside the DIALOG instruction, control the behavior of the instructions with control blocks, such as BEFORE DIALOG, AFTER ROW, BEFORE FIELD, or ON ACTION.
  7. 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.