WaitForCursorColumn
WaitForCursorColumn
Waits for the cursor to reach the specified column.
Syntax
FlexScreen.WaitForCursorColumn(Column, [WaitMSec])
Parameters
|
|
Column |
Integer, input |
|
|
|
The column number, starting at 1 for the first column. |
|
|
[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).
WaitForCursorColumn returns True as soon as the cursor is in the column, or False if the wait times out. If FlexScreen.EnableRuntimeError is True (the default), a timeout raises run-time error &H80131505, "Function 'WaitForCursorColumn' 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.WaitForCursorColumn(16)
Ok = FlexScreen.SendKeys("MyUserID")
Ok = FlexScreen.SendKeys(FlexKey.VT_RETURN)
End Sub