BEFORE INPUT block

The BEFORE INPUT block is executed once at dialog startup, before the runtime system gives control to the user. This block can be used to display messages to the user, initialize program variables and setup the dialog instance by deactivating unused fields or actions the user is not allowed to execute.

INPUT BY NAME cust_rec.* ...
   BEFORE INPUT
       MESSAGE "Input customer information"
       CALL DIALOG.setActionActive("check_info", is_super_user() )
       CALL DIALOG.setFieldActive("cust_comment", is_super_user() )
   ...

The fields are initialized with the defaults values before the BEFORE INPUT block is executed. When the INPUT instruction uses the WITHOUT DEFAULTS option, the default values are taken from the program variables bound to the fields, otherwise (with defaults), the DEFAULT attributes of the form fields are used.

You can use the NEXT FIELD control instruction in the BEFORE INPUT block, to jump to a specific field when the dialog starts.