Programming with Reflection

image\rwnprg32.gif ReadChars method


Syntax Chars = object.ReadChars(Count, [Timeout], [Options])



Reads the specified number of characters from the host.

If this method times out before the specified number of characters is received, no error is generated. The return value contains all characters received before the timeout occurred. You can determine if a timeout occurred by comparing the length of the return string with the Count argument.

When reading incoming data 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.


Count Argument Type: Integer
The number of characters to read. If this argument is set to 0, no error results and an empty string is returned.

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

Options Argument Type: Enumeration
Specifies additional, non-default behavior for the method. There are two options for this method:


 Specifies that the characters being received are binary data and should not be translated from the host character set into the PC character set.


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

 To specify both options, use the addition operator: rcNoTranslation + rcNoDisplay.


Chars Return type: String
The characters read from the host. The number of characters in the return string is the value of Count, unless a timeout occurred.


image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command