The session form of INTERACT

When you issue the INTERACT command, QMF places the user on the current panel and allows the user to issue QMF commands interactively. The INTERACT command provides another QMF "session" within your current session. The INTERACT command can place the user in either an interactive QMF session or an interactive GDDM ICU session.

A scenario

If you run a procedure that requires only one step to produce your report, like the following:

Figure 11. A simple procedure, without the INTERACT command
 /* This procedure prints the weekly sales report. */
 "RUN QUERY WEEKLY_SALES_Q (FORM=WEEKLY_SALES_F"
 "PRINT REPORT"

QMF displays the REPORT panel containing your formatted data with a message that says, "OK, your procedure was run."

However, you might decide to write a procedure involving several steps. If you want to see the intermediate results of a procedure, you must use the INTERACT command. To see the intermediate result of a procedure that runs more than one query, insert an INTERACT command immediately following the first RUN command:

Figure 12. Using INTERACT in a procedure
 /* This procedure generates a report showing annual sales.  */
 "RUN QUERY WEEKLY_SALES_Q (FORM=WEEKLY_SALES_F"
 "INTERACT"
 "RUN QUERY YEAR_TOTAL_Q (FORM=YEAR_TOTAL_F"

Then, when you run this procedure from the home panel, QMF displays the REPORT panel containing your formatted data. Next, you enter the END command from the REPORT panel, and the procedure continues, running the second query and displaying the final report. If you omit the INTERACT command, QMF displays only the final report without showing the result of the first query.

The INTERACT command produces the same effect when it is issued through the callable interface, although in REXX the same commands look like this:

Figure 13. Using INTERACT in a REXX application

·
·
·
call dsqcix "RUN QUERY WEEKLY_SALES_Q (FORM=WEEKLY_SALES_F" call dsqcix "INTERACT" call dsqcix "RUN QUERY YEAR_TOTAL_Q (FORM=YEAR_TOTAL_F"
·
·
·

The Call dsqcix "INTERACT" line is the REXX syntax for issuing the INTERACT command through the callable interface. You need to use the syntax required by your programming language to issue the INTERACT command through the callable interface.

Suppressing the display of reports

If you run a query in a QMF callable interface application, QMF by default displays the resulting report. However, you can tell QMF not to automatically display the resulting report by setting the DSQDC_DISPLAY_RPT global variable to zero (0). You can also set this global variable on the START command by specifying DSQADPAN=0.

This global variable is valid only when the RUN QUERY command is issued from an application. It does not affect the display of reports when RUN QUERY is issued from the QMF command line.

Ending an INTERACT session

When the user issues the END command, control returns to the process that issued the INTERACT command; however, the two sessions are not independent. Anything done during the INTERACT session remains in effect when the old session resumes. For example, if the user modifies the current form object in the new interactive session, the current form object in the old session contains these modifications when the new session ends.

If you want your application to display the QMF Home panel after the user issues an END command from a QMF object panel (the way interactive QMF does), add the logic from A REXX example of using an INTERACT l'QMF720oop.

[ Previous Page | Next Page | Contents | Index ]