Previous Topic: Asynchronous Operation Concepts

Next Topic: Waiting for Input

Invoke an Asynchronous &PANEL Operation

To issue a panel in asynchronous mode, code the TYPE=ASYNC operand on the &PANEL statement. Your procedure is suspended until the nominated panel is scheduled for display, and then control returns from the procedure to the statement immediately following the &PANEL statement.

At this stage, the system variable &RETCODE is set to indicate the result of the &PANEL statement.

The values in &RETCODE are equivalent to the return codes set if you specified &CONTROL PANELRC.

&RETCODE can contain one of the following values:

0

The display operation has not been performed because the nominated panel has already been displayed and input is now available from that earlier display.

This happens if your procedure repeatedly updates a panel but, between updates, the operator enters some input into a field on the panel and causes an input operation by pressing Enter or a function key. The input variables defined for the panel now contain the updated values as entered by the operator.

4

As for &RETCODE = 0, except no input fields have been changed, so the operator has only pressed Enter or a function key. Again, the display operation does not take place.

12

The display operation has been scheduled. The panel is displayed either for the first time or to update an earlier display of the same panel.

The meaning of &RETCODE = 12 is completely different from the same return code if a synchronous &PANEL statement is issued.