WaitForNoX
WaitForNoX
Waits for the host to be in a ready state (no input inhibited conditions). Not valid for VT emulation.
Syntax
FlexScreen.WaitForNoX([WaitMSec])
Parameters
|
|
[WaitMSec] |
Integer, input, optional |
|
|
|
Number of milliseconds before the wait times out. |
Remarks
If the optional WaitMSec parameter is specified, it is the maximum wait time. If it is omitted, FlexScreen.WaitTimeoutMSec is used (20000 unless changed).
WaitForNoX returns True as soon as input is no longer inhibited, or False if the wait times out. If FlexScreen.EnableRuntimeError is True (the default), a timeout raises run-time error &H80131505, "Function 'WaitForNoX' timed out after n ms.", and unless the macro handles the error, it stops. If the session is not connected, run-time error &H80131320, "The session is not connected.", is raised instead.
Note that under On Error Resume Next, the assignment is skipped when the error is raised. So a variable such as Ok keeps its previous value instead of becoming False. To test the result, set FlexScreen.EnableRuntimeError to False and check the return value (see EnableRuntimeError).
Example
Sub Main()
Ok = FlexScreen.WaitForNoX()
Ok = FlexScreen.SendKeys("MyUserID")
Ok = FlexScreen.SendKeys(FlexKey.ENTER)
End Sub