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 WaitReady 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 set to 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 WaitReady
only works after an AID key is sent to the host. If
WaitReady is used after data is
put in a field, but not sent to the host, then the wait count will never
be reached and the command will timeout (first parameter). When
converting macros and replacing WaitHostQuiet with WaitReady, be sure
the preceding command is Enter, PFKey, Attn, SysReq, or some other AID
key that causes the host to write to the screen.
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 2 below.
Example 1 (IBM Hosts):
Set Host = CreateObject( "BZWhll.WhllObj" )
Host.Connect "A"
Host.WriteScreen "list", 19, 7
Host.SendKey "@E"
Host.WaitReady 10, 2000 'wait 2 seconds for next screen to come down
Host.WriteScreen "x", 4, 16
Example 2 (Non-IBM Hosts):
Set Host = CreateObject( "BZWhll.WhllObj" )
Host.Connect "A"
sub logOn
Host.SendKey "root"
Host.WaitReady 0, 100 'wait 100 milliseconds before executing the next command
Host.SendKey "@E"
Host.WaitReady 0, 100 'wait 100 milliseconds before executing the next command
Host.focus
end sub