Displays the specified full screen panel.
&PANEL [ NAME= ] panelname
[ TYPE=SYNC | ASYNC ]
[ CDELAY=YES | NO ]
[ MODALL=NO | YES]
The &PANEL statement is used to request the display of a full-screen panel. If necessary, a full-screen environment is established for the NCL process.
The full-screen panel must have been previously defined in a panel library using the MODS : Panel Maintenance function. On catering for undefined panels, see Notes for this verb.
An &PANEL statement is used from any NCL procedure operating within a user processing region associated with a full-screen terminal.
Use of the &PANEL statement from a procedure not operating in a region that supports full-screen mode will result in an error.
Before the specified panel is displayed, it is scanned and system and user variables are substituted. Thus, user variables required by the panel must be created within the NCL procedure before issuing the &PANEL statement.
On completion of entry by the terminal operator, control will be returned to the NCL procedure statement following the &PANEL statement. Data entered by the terminal operator will be available in the user variables defined in the panel definition.
Operands:
The 1- to 12-character name of the panel. This panel must exist in a panel library accessible by the user.
Indicates whether this is a synchronous (SYNC) or asynchronous (ASYNC) panel request. Synchronous requests display the panel and cause the process to be suspended pending the arrival of input from the panel or expiry of a time-out period. Asynchronous requests result in immediate return of control to the process, with input arrival being notified in due course via &INTREAD.
This operand indicates whether or not contention delay is used for this panel. By default, when the panel is displayed on a terminal which is currently in input mode, panel services delays panel output for the period set by the SYSPARMS CDELAY operand. For CDELAY=NO, panel output overrides the terminal's input mode and the panel is displayed at once, if necessary, interrupting the operator.
This operand indicates how input fields on the panel are to be treated when &CONTROL FLDCTL is in effect. By default, only input fields changed by the operator or set by the program (using &ASSIGN OPT=SETMOD) will be returned in the modified field list.
If MODALL=YES is specified, every input field on the displayed panel will be returned in the modified field list. The modified field list is accessed using &ASSIGN OPT=MODFLD, or using the &ZMODFLD system variable.
Examples: &PANEL
.HELP &PANEL &HELPPANEL
&IF .&INKEY = .PF03 &THEN +
&RETSUB
&IF .&INKEY = .PF07 &THEN +
&HELPPANEL = HELP1
&IF .&INKEY = .PF08 &THEN +
&HELPPANEL = HELP2
&GOTO .HELP
Notes:
An NCL process's use of Panel Services is represented by a full-screen environment. Issuing an &PANEL statement will automatically establish a full-screen environment if one does not already exist. You can use the FSPROC command to initiate NCL processes with a full-screen environment. In this way, the process's activation is synchronized with its bidding for window ownership. The full-screen environment exists until the NCL process terminates or is explicitly terminated by the &PANELEND statement.
Note: For more information about the facilities provided for the processing of full-screen panels, see the Network Control Language Programming Guide.
An attempt to display a panel that has not been defined or has been incorrectly defined will normally result in termination of the procedure with an appropriate error message. However, using &CONTROL PANELRC it is possible for the procedure to receive notification through the &RETCODE system variable that the required panel does not exist or cannot be displayed due to syntax errors. If &CONTROL PANELRC is in effect, the &RETCODE system variable will be set to 16 on return from the &PANEL statement and the &SYSMSG system variable will contain the text of the message that describes the error. The procedure can test the &RETCODE variable and adjust its processing accordingly.
&CONTROL PANELRC implies that the procedure has been designed to cater for the range of return codes that is returned from an &PANEL statement. See the &CONTROL statement PANELRC operand for full details.
Any NCL process which has access to a full-screen window may issue &PANEL at any time. When multiple NCL processes are executing in the same NCL processing environment (invoked by the START command) they can all bid for the user window to display panels. To prevent another process from taking the window, a process must use the &CONTROL NOSHAREW option to indicate that it is not prepared to give up control of the window.
When the procedure is prepared to relinquish ownership of the window it should issue a &PANELEND statement, which allows any other process that wants the window for a panel display to gain access to it. An NCL process using asynchronous panels may issue &CONTROL SHAREW to indicate it is prepared to share the window without terminating its full-screen environment.
If INWAIT=0 is specified on a panel definition the panel is displayed before the issuing process continues. The issuing process may therefore be suspended indefinitely waiting for control of the window.
If INWAIT is specified with a positive interval defined, the panel will always be displayed for that interval from the time that the panel wins control of the window, regardless of how long it takes to get control of the window.
When displaying a panel with an INWAIT interval specified, your product region will only wait for the INWAIT interval (at maximum) to get control of the window. After that time the procedure regains control since the INWAIT period is considered to have passed.
| Copyright © 2009 CA. All rights reserved. |
|