When a panel is displayed, a data stream is created to format the physical screen as defined in the panel definition. For example, a panel may be displayed repeatedly as a monitor screen or similar, where the display time is controlled by the INWAIT operand. In this example, the INWAIT timer can expire while data or a command is still being entered in the panel. The entered data is ignored and the input field cleared when the panel is refreshed. The cursor position might also change.
You can use the #OPT FMTINPUT statement to avoid this problem by letting the procedure determine when input fields are formatted. So, if you are entering data when the screen is refreshed, and the FMTINPUT=NO specification is used, the entered data remains and you can complete entry unaffected.
By varying the FMTINPUT operand setting (through a variable set from within the procedure) from YES to NO, the procedure can toggle input field formatting on and off. For example:
#OPT FMTINPUT=&FMT
The first time a panel is displayed, it should always specify FMTINPUT=YES to ensure that the physical screen is correctly formatted. On subsequent refreshes (usually after INWAIT expires), FMTINPUT=NO can be used.
For example:
.FMTYES
&FMT = YES
&GOTO .DISPLAY
.FMTNO
&FMT = NO
.DISPLAY
&PANEL MYPANEL
&IF .&INKEY EQ . &GOTO .FMTNO
.
.
. standard processing
.
.
&GOTO .FMTYES
Note: The FMTINPUT operand is designed to work in conjunction with the INWAIT facility and must be used with care, or panel errors can result.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |