Wait – Function 4
This function determines whether the Host session is in a wait state. If, for some reason, the session is in a wait state, this function causes your Windows HLLAPI application to wait for the specified amount of time to see if the wait condition clears. The amount of time to wait is set by session options with Set Session Parameters (function 9).
Prerequisite functions
Connect Presentation Space (function 1)
Function call
WinHLLAPI(WAIT,lpbyString,lpwLength,lpwReturnnCode)
Call parameters
Parameter Description
Data String NA
Data Length NA
PS Position NA
Return code
Code Description
WHLLOK The keyboard is unlocked and ready for input.
WHLLNOTCONNECTED Your Windows HLLAPI application is currently not connected to a Host session.
WHLLPSBUSY Wait function timed out while still in XCLOCK or XSYSTEM for 3270 terminals, or Input Inhibited for 5250 terminals.
WHLLINHIBITED The keyboard is locked.
WHLLSYSERROR The function failed due to a system error.
WHLLCANCEL The asynchronous function was cancelled.
Remarks
Wait can be used to provide other functions, such as Send Key (function 3), enough time to complete or be processed. You can also use Wait to see if the keyboard is inhibited (return code of 4). Be aware, however, that when the return code is 0 (zero), the keyboard is unlocked and Wait has executed successfully, but the original transaction or preceding function may not have finished processing on the Host. If there are keywords or prompts you are expecting, use Search Field (function 30) or Search Presentation Space (function 6) in combination with Wait.
The length of time that this function will wait is affected by the session options TWAIT, LWAIT, and NWAIT. See Set Session Parameters (function 9) for details on these session options.