Wait.For
Description
- Wait for specified length of time, or for an expression to evaluate to true.
Syntax
- Wait.For(n, expr)
- Waits up to n milliseconds for expression expr to become true.
- Wait.For(n)
- Wait.For(expr)
- Waits for expression expr to become true.
Parameters
- n
- (integer) length of time in milliseconds
- expr
- (bool) expression to evaluate
Examples
- Wait.For(300)
- Wait.For(activewindow("=notepad"))
- Wait.For(300, activewindow("=notepad"))
Notes
- Only one Wait.For() can be running at a time.
- Nested Wait.For()'s are always stopped in reverse order of issuance.
- Wait.For() will not accept an argument from a function call as its n parameter [length of time to wait] when the syntax being used is Wait.For(n), where n is an integer.
i.e. The following will not wait, no matter what arg(1) evaluates to:
Wait.For( arg(1) )
To use the value of arg(1) in the Wait.For() call, use:
- Wait.ForInterval()
- the &() format: Wait.For( &(arg(1)) ) [deprecated]
See Also