You can modify your application at run time with user input and environment conditions by using Dialogue Manager procedures, which include commands and variables. It is important to understand how Dialogue Manager processes commands and variables of an application, using a procedure.
Dialogue Manager executes a procedure as follows:
You must make sure to assign values or identify defaults for all variables. Otherwise, you will receive an error message indicating a missing value. In Developer Studio, you are prompted for values not already assigned.
Other WebFOCUS commands are temporarily stored for subsequent execution, which are called stacked commands.
The following diagram illustrates how a Dialogue Manager procedure is processed:
The following is an example of a procedure, with an explanation of the way it processes.
The procedure contains the variable &PLANT. Assume that when the procedure executes it includes the variable value of BOS for &PLANT. The numbers on the left correspond to the notes explaining the code.
1. -IF &PLANT EQ 'DONE' THEN GOTO GETOUT; 2. TABLE FILE CENTHR HEADING "SALARY REPORT FOR LOCATION: &PLANT" PRINT SALARY POSITION BY LNAME WHERE PLANT IS '&PLANT' END 3. -RUN 4. -EXIT -GETOUT -TYPE NO PROCESSING DONE: EXITING
The procedure processes as follows:
If the value were DONE instead of BOS, control would pass to the label -GETOUT, and the message NO PROCESSING DONE: EXITING would be generated. Dialogue Manager would skip the report request.
After Dialogue Manager processes the END command, the stacked commands look like this:
TABLE FILE CENTHR HEADING "SALARY REPORT FOR LOCATION: BOS" PRINT SALARY POSITION BY LNAME WHERE PLANT IS 'BOS' END
The next line is then processed by Dialogue Manager.
To display populated variable values like those contained in this step, include the &ECHO variable in your procedure. For information on the &ECHO variable, see Testing and Debugging a Dialogue Manager Procedure.
For complete information on using variables in procedures, see Customizing a Procedure With Variables.