Programming with Reflection

image\rwnprg32.gif WaitForString method


Syntax Found = object.WaitForString(String, [Timeout], [Options])



Waits for a specified string to be received from the host.

When waiting from an external application (such as stand-alone Visual Basic), the ProcessDatacomm property should be set to False to prevent Reflection from reading and processing characters between calls to Reflection methods.


String Argument Type: String
The string for which to wait. Reflection considers case (the incidence of uppercase and lowercase letters) in testing incoming data for a matching string. If String is an empty string (""), this method returns immediately without reading incoming data.

Timeout Argument Type: String
Specifies the amount of time to wait for the string to be received. The string is specified in HH:MM:SS.hh format. If this argument is omitted or is empty (""), Reflection waits forever if the string is not received.

Options Argument Type: Enumeration
Specifies additional, non-default behavior for the method. There are three options for this method. You can combine two or more options using addition as shown here:

      .WaitForString "Hello", , rcAllowKeystrokes + rcNoDisplay


 Specifies that the user is allowed to enter keystrokes in the terminal window during the wait.


 Specifies that incoming datacomm characters should not be displayed in the terminal window during the wait.


 Specifies that the string contains binary data. Binary data is matched exactly as it is received from the host without any host-to-PC character translation.


 Indicates that portions of a string that follow a backslash should be interpreted using either hexadecimal code or C-language character conventions. For example, the following statement waits for the fraction symbol ¼ (specified using the decimal code x0BC) followed by a carriage return (specified using the \r special character):

        .WaitForString "\x0BC\r", rcHexData


Found Return type: Boolean
True if the specified string was received from the host, or False if the string was not received before the method timed out. If no Timeout is specified, this method cannot return False.


image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command