Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmScreen Object / GetText Method
Field row location.
Field column location.
Text length.
Example
In This Topic
    GetText Method (IbmScreen)
    In This Topic
    Gets the text from the specified location.
    Syntax
    expression.GetText( _
       ByVal row As Integer, _
       ByVal column As Integer, _
       ByVal length As Integer _
    ) As String
    where expression is a variable that represents a IbmScreen Object

    Parameters

    row
    Field row location.
    column
    Field column location.
    length
    Text length.

    Return Value

    Text from specified location.
    Exceptions
    ExceptionDescription
    This exception is thrown if the row or column parameters are outside the range of valid values: (1 to Rows) or (1 to Columns), or if length is invalid.
    Remarks

    The length argument specifies the number of screen bytes to get. In SBCS, the number of screen bytes is the same as that of the ScreenCharacter objects. In DBCS, the two numbers can be different. If the last byte is only half of a DBCS character, the last byte is not returned.

    For more about using GetText, see: 

     

     

     

    Example
    This sample gets data by row and prints it to the VBA editor Immediate window. To run this sample in the IBM3270 demo, start a session with the host adress set to demo:ibm3270.sim. Then enter any credentials to log in and enter "kayak" on the next screen to go to the " INTERNATIONAL KAYAK ENTERPRISES" screen. From the VBA Editor View menu, choose Immediate Window and then run this macro.
    Sub GetRowsOfData()
       
        Dim path As String
        Dim rowText As String
        Dim col, row As Integer
        Dim rowFromHost() As String
     
           
        'Starting on row 7, get the first row of data
        row = 7
        rowText = ThisIbmScreen.GetText(row, 9, 65)
       
        Do
            'Get a row of data
            rowText = Trim(rowText)
           
            'Print the row
            Debug.Print rowText
           
            'Get the next row of data from the screen
            row = row + 1
            rowText = ThisIbmScreen.GetText(row, 9, 65)
           
        'Loop until the first empty row
        Loop While Len(Trim(rowText)) > 1
          
    End Sub
    See Also