WaitForTimer Method

image\btn_example.gif

image\validfor_amv.gif

Applies To Objects

Session

Description

Waits for the specified number of milliseconds to elapse.

Syntax

object.WaitForTimer [Time] [, bContinuous]
-or-

rc = object.WaitForTimer( [Time] [, bContinuous] )
-or-

Set waitobj = object.WaitForTimer( [Time] [, bContinuous] )

Element

Description

rc

The return value.

object

The Session object.

Time

The number of milliseconds to wait. If this value is omitted, the default Time will be the System.TimeoutValue.

bContinuous

Boolean value indicating whether the wait-type object returned by this method will signal its event just once, or repeatedly every Time milliseconds.

Set

The Set statement, required for assigning an object reference to a variable.

waitobj

A wait-type object.

Comments

When either of the first two syntax forms above is used, WaitForTimer will suspend execution of your macro or program (i.e. wait) for the specified milliseconds. If the third form is used, WaitForTimer will return immediately and the wait-type object returned can be used with the Waits collection, which allows several separate events to be monitored simultaneously. For more information on this, see help for the Waits object.

The wait-type object returned by WaitForTimer can be useful if you want to use zero as the timeout value for the Waits.Wait method. Doing so indicates that method should wait an infinite amount of time for one of the wait-type objects in the collection to signal its event. In that situation, a wait-type object returned by WaitForTimer can be used to check the timeout.