EnableRuntimeError

Enable or disable when WaitForString or SendKeys fails. Default to be true (enabled).


This is useful to address the following situation:


When "On Error Resume Next" is specified and when FlexScreen.WaitForString is used in a conditional statement, and if it times out, a runtime error occurs. The on error resume next causes the next statement to be executed before the conditional statement is evaluated.


Syntax

FlexScreen.EnableRuntimeError


Example


The following example, if EnableRuntimeError is true, "Text found!" will erroneously always be executed.


Sub Main()
   On Error Resume Next
   FlexScreen.EnableRuntimeError = False
   If FlexScreen.WaitForString("Userid1", FlexScreen.Position(10, 11)) = True then
      MsgBox "Text found!"
   Else
      MsgBox "Text Not Found!"
   End If
End Sub