InfoConnect VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmScreen Object / SendControlKey Method
The ControlKeyCode Enumeration enum value that specifies the host control key to send to the host.
Example
SendControlKey Method (IbmScreen)
Send host control key to host.
Syntax
expression.SendControlKey( _
   ByVal keycode As ControlKeyCode _
) As ReturnCode
where expression is a variable that represents a IbmScreen Object

Parameters

keycode
The ControlKeyCode Enumeration enum value that specifies the host control key to send to the host.

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.
Remarks
Example


This sample uses the WaitforCursor1 and SendContolKey methods to navigate to 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 run the macro from the login screen.

Sub NavigateWithSendControlKey()
    'Declare terminal, screen, and rcode variables:
    Dim terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmTerminal
    Dim screen As Attachmate_Reflection_Objects_Emulation_IbmHosts.IbmScreen
    Dim rcode As ReturnCode
 
    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.WaitForCursor1(2000, 23, 1)
    rcode = screen.SendKeys("ISPF")
    rcode = screen.SendControlKey(ControlKeyCode_Transmit)
  
    rcode = screen.WaitForCursor1(2000, 2, 15)
    rcode = screen.SendKeys("2")
    rcode = screen.SendControlKey(ControlKeyCode_Transmit)
  
    rcode = screen.WaitForCursor1(2000, 11, 18)
    
   
    'Put some text into a field on the last screen
    rcode = screen.PutText2("Finished", 5, 18)
   
End Sub
See Also