WaitForStream Method

image\btn_example.gif

image\validfor_v.gif

Applies To Objects

Screen

Description

Waits until the specified text appears in the host data stream. This method will wait for the length of time set in System.TimeoutValue.

Syntax

object.WaitForStream Text [, IdleTime] [, Timeout] [, options]
-or-

rc = object.WaitForStream ( Text [, IdleTime] [, Timeout] [, options] )
-or-

Set waitobj = object.WaitForStream ( Text [, IdleTime] [, Timeout] [, options] )

Element

Description

object

The Screen object.

Text

The string or expression (as determined by options) to be found.

IdleTime

The number of milliseconds the data stream must be idle (no received data) after having matched the text.

Timeout

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

options

These can be combined:

xRegExp – Text is a Regular Expression (default)

xNoCase – ignore case for match.

rc

Returned value for the second syntax form above.TRUE if the the specified Text was found: FALSE if timeout occurred.

Set

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

waitobj

A wait-type object.

Comments

Regular expression matching means that wildcards such as ? or * can be used in the Text string to be matched. For example, use a question mark to replace an individual character: "bi??er" would be successfully matched as either "bigger" or "bidder" or "bipler". Use of an asterisk in the Text string allows a string such as "abc*" to be successfully matched as "abcd" or "abcWhatever".

When either of the first two syntax forms above is used, WaitForStream will suspend execution of your macro or program (i.e. wait) until the search Text appears in the host data stream, or a timeout occurs. If the third form is used, WaitForStream 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 following constants are used by WaitForStream and WaitForString.

Constant

Value

Description

xRegExp

1

Text is a Regular Expression.

xNoCase

2

Ignore case when matching.

xStrip

4