Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Screen Object / GetCharacters Method
The screen row position.
The screen column position.
The number of characters to obtain.
Example
In This Topic
    GetCharacters Method (Screen)
    In This Topic
    Gets ScreenCharacter objects from the specified location, each representing one character at a screen location.
    Syntax
    expression.GetCharacters( _
       ByVal row As Integer, _
       ByVal column As Integer, _
       ByVal length As Integer _
    ) As ScreenCharacter()
    where expression is a variable that represents a Screen Object

    Parameters

    row
    The screen row position.
    column
    The screen column position.
    length
    The number of characters to obtain.

    Return Value

    An array of the ScreenCharacter objects at the specified position.
    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).
    Remarks
    The length argument specifies the number of screen bytes to get. In the single-byte character set (SBCS), the number of screen bytes is the same as that of ScreenCharacter objects. In the double-byte character set (DBCS), the two numbers can be different. If the last byte is only half of a DBCS character, the last byte is not returned.
    Example
    'This example gets some characters on the screen and prints the character code of each character.
    Sub GetAndPrintChars()
        Dim position As ScreenPoint
        Dim chars() As ScreenCharacter
           
        'Set the starting point
        Set position = ThisScreen.SearchText("Jan", 0, ThisScreen.DisplayColumns, FindOptions_Forward)
        
        'Get 25 characters on this row
        chars = ThisScreen.GetCharacters(position.Row, position.Column, 25)
        
        'loop through the entire array and print the character codes of each character
        For i = 0 To UBound(chars)
        
            If Not chars(i).IsNoCharacter Then
                Debug.Print chars(i).charCode
            End If
            
        Next i
           
    End Sub
    See Also