Long-running NCL procedures do not execute continuously. At some point in their logic they go into a wait state, waiting for some event to occur that triggers them to start processing again. A typical example of such an event is input received from the operator.
With synchronous &PANEL operation, the &PANEL statement implies a wait-for-input condition. With asynchronous &PANEL operation, the panel statement itself does not wait for input from the terminal, so another mechanism is needed which tells the procedure when input has been received. The mechanism used is &INTREAD and the procedure's dependent request queue.
When an asynchronous panel is displayed and something happens on the window (for example, the operator enters input to the panel), a special message is delivered to the procedure's dependent request queue in the format:
N00101 NOTIFY: PANEL EVENT: event-type RESOURCE:panelname
where event-type describes the type of input activity that is being notified.
When the procedure reaches a point in its logic where it needs to wait for input from the terminal, it issues an &INTREAD TYPE=REQ statement. This automatically places it in a wait state until a request message arrives on its dependent request queue.
When input is entered by the operator, the N00101 message is delivered to the dependent request queue, satisfies the &INTREAD statement and the procedure wakes up. By examining the contents of the N00101 message the procedure can determine that it is a notification of a panel event occurring on the asynchronous panel.
It is important to note that the message is only a notification that a panel event has occurred. The action taken by the NCL procedure after reading the message depends on the event. The possible events and associated actions are:
Input has been received from the terminal. For the input to be made available to the NCL procedure in the associated panel input variables, it is necessary for the procedure to issue an &PANEL TYPE=ASYNC statement.
The terminal window conditions have been changed. This could indicate that a redefinition of the window dimensions has occurred (a SPLIT or SWAP operation has taken place).
A broadcast has been sent to the panel. For the broadcast to appear on the asynchronous panel currently displayed, it is necessary for the procedure to issue another &PANEL statement.
Another NCL process has attempted to take over the window. The NCL process is only notified of this event if it is the window owner and &CONTROL NOSHAREW is in effect. To allow another NCL process to acquire ownership of the window, the NCL procedure can issue a &PANELEND or a &CONTROL SHAREW statement.
If an INPUT, CHANGE, or BCAST event occurs, the NCL procedure very often issues an &PANEL statement to obtain the input to the asynchronous panel. This statement must specify the name of the panel being displayed when the &INTREAD statement was issued. The &PANEL statement completes with the appropriate &RETCODE return code value, as described previously. If an &PANEL statement specifying another panel name is issued after the N00101 message is read, the input is no longer available.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |