WaitForDisconnect Method

image\btn_example.gif

image\validfor_v.gif

Applies To Objects

Session

Description

Waits for the host session to become disconnected. This method will wait for the amount of time set in System.TimeoutValue.

Syntax

object.WaitForDisconnect [Timeout]
-or-

rc = object.WaitForDisconnect( [Timeout] )
-or-

Set waitobj = object.WaitForDisconnect( [Timeout] )

Element

Description

object

The Session object.

Timeout

A number of milliseconds which can be provided to override the System.TimeoutValue for this call only.

rc

Return value for second syntax form above. TRUE if the session disconnected before the timeout interval elapsed.

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, WaitForDisconnect will suspend execution of your macro or program (i.e. wait) until the host session becomes disconnected, or a timeout occurs while waiting. If the third form is used, WaitForDisconnect 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.