WaitReady

Suspends script execution until the host screen is ready for keyboard input. (Not recommended for VT sessions.)

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. Refer to Error codes for a complete listing of error code descriptions.
Remarks
The WaitReady function must 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 is suspended until the host machine sends the specified number of keyboard restores. Refer to the BlueZone status bar to determine the keyboard restore count for a given screen. In the following screen shot Ready (2) on the status bar 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 is never reached and the command times out (first parameter). When converting macros and replacing WaitHostQuiet with WaitReady, ensure the preceding command is Enter, PFKey, Attn, SysReq, or some other AID key that causes the host to write to the screen.
Non-IBM remark
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 bzhao = CreateObject( "BZWhll.WhllObj" )
bzhao.Connect "A"
bzhao.WriteScreen "list", 19, 7
bzhao.SendKey "@E"
bzhao.WaitReady 10, 2000   'wait 2 seconds for next screen to come down
bzhao.WriteScreen "x", 4, 16
Example 2 (non-IBM hosts)
Set bzhao = CreateObject( "BZWhll.WhllObj" )
Host.Connect "A"
   Host.SendKey "root"
   Host.WaitReady 0, 100  'wait 100 milliseconds before executing 
   the next command
   Host.SendKey "<Enter>"
   Host.WaitReady 0, 100  'wait 100 milliseconds before executing 
   the next command