Suspends script execution until the host screen is ready for keyboard input.
Parameters:
TimeoutVal - The number of seconds to wait before returning with a "session is busy" error code.
ExtraWaitVal - The number of milliseconds to validate for a keyboard unlocked status. For a detailed explanation, see the Remarks section below.
NOTE The
above features behave differently when scripting non-IBM hosts. See
Non-IBM Remarks below.
Returns:
0 for success; or a non-zero error code. See Error Codes for a complete listing of error code descriptions.
Remarks:
The EMWaitReady function should be called each time after sending a Attention Identifier Key (such as a PF key) to the display session.
If ExtraWaitVal is a value in the range of 1, 2, 3, on up to 50, then script execution will be suspended until the host machine sends the specified number of keyboard restores. Refer to the BlueZone StatusBar to determine the keyboard restore count for a given screen. In the following screen shot Ready (2) on the StatusBar means two keyboard restores were detected when this particular screen was written by the host.
If ExtraWaitVal is 51 or higher, the operation of the parameter changes to specify the number of milliseconds to wait after the keyboard lock has been detected prior to executing the next script command.
NOTE If
-1 is specified for the ExtraWaitVal
parameter, then the Speed Control setting in Options:Script
Host Properties will be used.
SEE How
to Use the Script Speed Control for more information.
Non-IBM Remarks:
TimeoutVal and ExtraWaitVal behave differently when scripting non-IBM hosts. That is because "keyboard locked status" is not supported on non-IBM hosts. When scripting on Non-IBM Hosts, set TimeoutVal to "0", and treat ExtraWaitVal as a pause before the scripts moves on to the next command. See Example 3 below.
Example 1:
EMWriteScreen "list", 19, 7
EMSendKey "@E"
EMWaitReady 10, 2000 'wait 2 seconds for next screen to come down
EMWriteScreen "x", 4, 16
Example 2 (Using Speed Control):
EMWriteScreen "list", 19, 7
EMSendKey "@E"
EMWaitReady -1 'use Speed Control to determine script delay
EMWriteScreen "x", 4, 16
Example 3 (Non-IBM Hosts):
EMWrite "list", 19, 7
EMSendKey "root"
EMWaitReady 0, 100 'wait 100 milliseconds before executing the next command
EMSendKey "@E"
EMWaitReady 0, 100 'wait 100 milliseconds before executing the next command