InfoConnect VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Screen Object / GetText Method
The starting row position.
The starting column position.
The number of screen character positions from which to return data.
Example
GetText Method (Screen)
Retrieves text from the specified screen region. Text from the "wrapped" region is returned.
Syntax
expression.GetText( _
   ByVal startRow As Integer, _
   ByVal startColumn As Integer, _
   ByVal length As Integer _
) As String
where expression is a variable that represents a Screen Object

Parameters

startRow
The starting row position.
startColumn
The starting column position.
length
The number of screen character positions from which to return data.

Return Value

The requested string.
Remarks
If the row or column parameters are outside the range of valid values (1 to Rows) or (1 to Columns), an empty string is returned.

End-of-line characters (CR/LF) can cause the returned string to be longer than the specified length parameter. The length argument specifies the number of screen bytes to get. In a single-byte character set (SBCS), the number of screen bytes is the same as the number of screen character positions from the specified start location, whether they contain data or not.

However, when the requested region includes the last character position on a line, the end-of-line characters (typically a CR/LF combination) are embedded in the returned text on all but the last line. For example, specifying startcolumn = 1 and length = 160 on an 80 character screen could return 162 bytes, due to the end-of-line characters.

In a double-byte character set (DBCS), data at the end of the reqested region can be truncated if it is not a full byte DBCS character. If the last byte is only one half byte of a DBCS character, the last byte is not returned.

For more about using GetText, see: 

Example
This sample gets all the text from the top row of the display memory to the end and prints it to the Immediate window. Before you run this sample, choose Immediate Window from the VBA Editor View menu.
Sub getTextFromScreen()
 
     Dim maxRow As Long, maxCol As Long, firstCol As Long, fnum As Integer
    
     maxRow = ThisScreen.DisplayRows
     maxCol = ThisScreen.DisplayColumns
     topRow = ThisScreen.DisplayMemoryTopRow
     length = maxRow * maxCol
     
     
    Dim returnValue As Integer
    
    Dim text As String
    
    'Get all the text on the screen from the top row to the laste row and column
    text = ThisScreen.GetText(topRow, 1, length)
    
    
    Debug.Print text
 
End Sub
See Also