Wait Method
image\btn_example.gif

image\validfor_amv.gif

Applies To Objects

Waits

Description

Waits for one of the wait-type objects added to the collection to signal its event.

Syntax

ret = object.Wait(nMilliseconds)

Element

Description

object

The Waits object.

nMilliseconds

Number of millisecond to wait before returning with a timeout error. If this value is zero, the Wait method will wait indefinitely.

ret

Return value is the 1-based index identifying which wait-type object in the collection signaled its event to terminate the Wait. A return value of zero indicates a timeout error: none of the wait-type objects in the collection signaled their event before nMilliseconds elapsed.

Comments

The Waits object is a collection object used to control and check on the status of number of "wait-type" objects. When used with the Set keyword, the following methods will immediately return a wait-type object, rather that waiting synchronously for their operations to complete:

 WaitHostQuiet

 WaitForString

 WaitForStream

 WaitForCursor

 WaitForCursorMove

 WaitForKeys

 WaitForDisconnect

 WaitForTimer

 SendFile

 ReceiveFile

 NavigateTo

After retrieving several wait-type objects using the above methods, use the Add method to add them to the Waits collection object. Then, through use of the Wait method, it is possible to simultaneously monitor the status of all the objects in the collection.