Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmScreen Object / WaitForText2 Method
Wait timeout value in milliseconds.
Text string.
Start row.
Start column.
End row.
End column.
A TextComparisonOption Enumeration value that defines how text is compared against the text on the host screen.
Example
In This Topic
    WaitForText2 Method
    In This Topic
    Waits for the specified text to appear at the specified rectangle area specified. TextComparisonOption indicates desired text string comparison.
    Syntax
    expression.WaitForText2( _
       ByVal timeout As Integer, _
       ByVal text As String, _
       ByVal startRow As Integer, _
       ByVal startColumn As Integer, _
       ByVal endRow As Integer, _
       ByVal endColumn As Integer, _
       ByVal option As TextComparisonOption _
    ) As ReturnCode
    where expression is a variable that represents a IbmScreen Object

    Parameters

    timeout
    Wait timeout value in milliseconds.
    text
    Text string.
    startRow
    Start row.
    startColumn
    Start column.
    endRow
    End row.
    endColumn
    End column.
    option
    A TextComparisonOption Enumeration value that defines how text is compared against the text on the host screen.

    Return Value

    One of the following ReturnCode enum values.

    Member Description
    Cancelled Cancelled.
    Error Error.
    PermissionRequired Permission is required.
    Success Success.
    Timeout Timeout condition.
    Truncated The text is truncated.
    Example
    This sample uses the WaitForText2 method to navigate to a the "Edit - Entry Panel" Screen on the Reflection IBM3270 demo and writes some text on the last screen. To run this sample, create a 3270 session and set the Host name / IP address to demo:ibm3270.sim. Then paste this code into a VBA module and then run the macro from the login screen.
    Sub NavigateWithWaitForText2()
        'Declare application, terminal, and view object variables:
        Dim terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmTerminal
        Dim screen As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmScreen
     
        Set terminal = ThisIbmTerminal
      
        'Get a handle to the Screen object and navigate to the screen we
        'want to enter the data on
        
        Set screen = terminal.screen
      
        'Navigate to the screen
        rcode = screen.SendControlKey(ControlKeyCode_Transmit)
        
        rcode = screen.WaitForText2(2000, "LOGON", 1, 1, 24, 80, TextComparisonOption_MatchCase)
        rcode = screen.SendKeys("ISPF")
        rcode = screen.SendControlKey(ControlKeyCode_Transmit)
      
        rcode = screen.WaitForText2(2000, "OPTION", 2, 2, 24, 80, TextComparisonOption_MatchCase)
        rcode = screen.SendKeys("2")
        rcode = screen.SendControlKey(ControlKeyCode_Transmit)
      
        rcode = screen.WaitForText2(2000, "COMMAND", 2, 2, 24, 80, TextComparisonOption_MatchCase)
          
        'Put some text into a field on the last screen
        rcode = screen.PutText2("Finished", 5, 18)
     
       
    End Sub
    See Also