Reads a specified number of characters from the host.
expression.ReadChars2( _
ByVal As Integer, _
ByVal As Integer _
) As String
where
expression is a variable that represents a
Screen Object
Parameters
- count
- The number of characters to read. If zero is specified, an empty string is returned.
- timeout
- The time (in seconds) to wait for the specified number of characters.
Return Value
A string that contains the requested number of characters or all of the characters received prior to a timeout.
This example reads the first 1000 characters received from the host.
Sub ReadSetNumberOfChars()
Dim charactersReceived As String
'Send a command
ThisScreen.SendKeys "ls"
ThisScreen.SendControlKey ControlKeyCode_Return
'Read the first 1000 characters
charactersReceived = ThisScreen.ReadChars2(1000, 1)
Debug.Print charactersReceived
End Sub