Search Method  
 

Search for a specific character sequence in the data stream.

Syntax

object.Search( String, [Buffer], [Length], [Options] )

Parameters

String
A string argument which specifies the sequence of characters to search for in the data stream. When the control encounters this sequence, the method will return.
Buffer
An optional string or byte array buffer that will contain the output sent by the server, up to and including the search string character sequence. If this argument is omitted, the control will still search for the character sequence but any output sent by the server will be discarded.
Length
An optional integer value which specifies the maximum number of bytes of data to store in the buffer. If this argument is omitted, no limit will be placed on the amount of output buffered by the control.
Options
An optional integer argument which is reserved for future use. This argument should be omitted.

Return Value

This method returns a Boolean value. A return value of true indicates that the search string was found in the data stream. A return value of False indicates that the search string was not found in the amount of time specified by the Timeout property or that the server closed the connection.

Remarks

The Search method searches for a character sequence in the data stream and stops reading when it is found. This is useful when the client wants to automate responses to the server, such as executing a command and processing the output. The function collects the output from the server and stores it in a buffer provided by the caller. When the function returns, the buffer will contain everything sent by the server up to and including the search string.

See Also

IsReadable Property, Timeout Property, Execute Method, Login Method, Read Method