Terminal control options:
- bits: 0 - 8
Reserved for system use.
- 9 - 10
01 = Enable ENTER or function key timeout in VREADFIELDS.
00 = Disable ENTER or function key timeout in VREADFIELDS (default).
- 13 - 14
01 = Enable AUTOREAD in VREADFIELDS.
00 = Disable AUTOREAD in VREADFIELDS (default)
- 15
0 = Display mode message (default)
1 = Suppress mode message.
Normally, there is no time limit for VREADFIELDS, whether the intrinsic is terminated by ENTER or a function key. Timeouts can be enabled in applications
by setting bit 10 of the termoptions item of the comarea to 1, and specifying a timeout interval in the usertime item of the comarea. When a timeout is enabled, if ENTER or a function key is not pressed within the number of
seconds specified in comarea position 58, the cstatus of 160 will be returned to the comarea. At this point, control will then be passed to the
statement following the VREADFIELDS call in the application.
For example, in COBOL:
INITIALIZE-COMAREA MOVE ZERO TO COM-OPTIONS. ADD 32 TO COM-OPTIONS. MOVE 60 TO COM-USERTIME.
|
if included in the initialization section of the application
will indicate that all calls to VREADFIELDS should timeout after
60 seconds. Note that an ADD instruction was used to turn on the
timeout feature. All changes to the termoptions item following VOPENTERM should be careful to set only single bits, as
VPLUS uses bits 0-7. A MOVE instruction will destroy the configuration of
these bits.
When VREADFIELDS is terminated by a function key, VPLUS does not transmit
any data entered on the screen to the user buffer. If the programmer
wishes for data to be transmitted to the data buffer when a function
key is pressed, the AUTOREAD feature should be enabled. The following COBOL
example shows how to enable the autoread feature, and transfer data
to the buffer when the function key f4 is pressed:
CALL "VREADFIELDS" USING COMAREA. IF COM-LASTKEY = 4 THEN ADD 2 TO COM-OPTIONS CALL "VREADFIELDS" USING COMAREA SUBTRACT 2 FROM COM-OPTIONS.
|
Note that two VREADFIELDS calls are necessary to complete the process. The
first VREADFIELDS detects that a function key was pressed, the second call
actually transmits the data to the data buffer. The second call
to VREADFIELDS does not wait for the user to press enter, but
rather sends an "ESC d" to the terminal to simulate an automatic
enter. As noted above in the description of user timeouts, the COBOL SUBTRACT and ADD statements should always be used when setting
bits in the termoptions item of the comarea.
The mode message is displayed on terminals not automatically configured by VPLUS. The mode message
for VOPENTERM is BLOCK MODE/PAGE IS SET; for VCLOSETERM it is REMEMBER TO UNLATCH THE BLOCK MODE KEY.