InfoConnect VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Screen Object / SendKeys Method
The text to send to the host
Example
In This Topic
    SendKeys Method (Screen)
    In This Topic
    Sends the text string to the host.
    Syntax
    expression.SendKeys( _
       ByVal text As String _
    ) As ReturnCode
    where expression is a variable that represents a Screen Object

    Parameters

    text
    The text to send to the host

    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 sample navigates to a screen and waits until a string is received from the host. To run this sample, create a VT session with the connection type set to TelNet and the Host name/IP address field set to "unix:demo" and log in to the demo with any text.
    'This sample waits Until a String is received From the host.
    Sub NavigateWithWaitForString()
        Dim rcode As ReturnCode
        
        'a value of 0 specifies to never timeout
        Const NEVER_TIME_OUT = 0
        
        'Enter a command
        ThisScreen.SendKeys "demodata"
        ThisScreen.SendControlKey ControlKeyCode_Return
        
        'Wait for a string on the host screen before continuing
        rcode = ThisScreen.WaitForString(LF & "Command> ")
     
        If rcode = ReturnCode_Success Then
            'Continue with commands
        End If
    End Sub
    See Also