Understanding declarative dialogs

Declarative dialogs are defined with DIALOG blocks at the module level.

A declarative dialog block is a module element defined at the same level as a FUNCTION or REPORT routine:

-- Module orders.4gl
SCHEMA stock
DEFINE arr DYNAMIC ARRAY OF RECORD LIKE orders.*
DIALOG orders_dlg()
  DEFINE x INT
  DISPLAY ARRAY arr TO sr_orders.*
     ...
  END DISPLAY 
END DIALOG
The name of a declarative dialog is mandatory is to be referenced by a SUBDIALOG clause, and can identify sub-dialog actions with a prefix.

When using the DIALOG keyword inside a declarative dialog block to use ui.Dialog class methods, it references the current instance of the dialog object.