Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Screen Object / WaitForIncomingData2 Method
wait timeout value (milliseconds). Value of 0 indicates wait indefinitely.
Example
In This Topic
    WaitForIncomingData2 Method
    In This Topic
    Waits for any data to come from the host during which time the keyboard is disabled.
    Syntax
    expression.WaitForIncomingData2( _
       ByVal timeout As Integer _
    ) As ReturnCode
    where expression is a variable that represents a Screen Object

    Parameters

    timeout
    wait timeout value (milliseconds). Value of 0 indicates wait indefinitely.

    Return Value

    One of the following ReturnCode enumeration values.

    Member Description
    Cancelled Cancelled.
    Error Error.
    PermissionRequired Permission is required.
    Success Success.
    Timeout Timeout condition.
    Truncated The text is truncated.

    Example
    This example waits for the response from the host after a controlkey is sent in the VT terminal.
    Private Sub Screen_ControlKeySent(ByVal sender As Variant, ByVal Key As Attachmate_Reflection_Objects_Emulation_OpenSystems.ControlKeyCode)
        
        Dim text As String
        
        'Print the control key that sent the command
        Debug.Print "key " & Key
        
        'When text is received by the VT terminal from the host, print the screen
        If ThisScreen.WaitForIncomingData2(1000) = ReturnCode_Success Then
        
            text = ThisScreen.GetText2(1, 1, ThisScreen.DisplayRows, ThisScreen.DisplayColumns)
            
            Debug.Print text
            
        End If
      
    End Sub
    See Also