Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmScreen Object / MoveCursorTo1 Method
The row to move the cursor to.
The column to move the cursor to.
Example
In This Topic
    MoveCursorTo1 Method
    In This Topic
    Moves the cursor to the specified screen location.
    Syntax
    expression.MoveCursorTo1( _
       ByVal row As Integer, _
       ByVal column As Integer _
    ) As ReturnCode
    where expression is a variable that represents a IbmScreen Object

    Parameters

    row
    The row to move the cursor to.
    column
    The column to move the cursor to.

    Return Value

    ReturnCode indicates success, failure, or a warning condition if the cursor position reaches the screen boundary.

    The ReturnCode enum values are shown below.

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

    Remarks

    If either row or column is out of screen bounds, the method moves the cursor, but movement is bound by the screen dimension.

    For more about using MoveCursorTo1 see:

    Navigating Through Open Systems Sessions

    Example

    This sample finds the "COMMAND" text on a screen and then moves the cursor to the unprotected field next to the text.

    To run this sample in the IBM3270 demo:

    1. Create a 3270 session and set the Host name / IP address to demo:ibm3270.sim.
    2. Then log in with any credentials, and enter "ispf" on the next screen.
    3. On the ISPF/PDF PRIMARY OPTION PANEL screen, enter 1.

    When the screen opens, the cursor position is 12, 18.
    After you run the macro on this screen, the cursor position is moved to the screen next to the COMMAND field.

    This example cuts and pastes text from one field to another.
    Sub SearchAndMove()
        Dim Point As ScreenPoint
        Dim rtncode As ReturnCode
     
        'Find the screen position of the Command Field
        Set Point = ThisIbmScreen.SearchText1("COMMAND", 1, 1, FindOption_Forward)
              
        'Move the cursor to the field for this label (offsetting the label to the start of the unprotected field that follows the COMMAND field
        rtncode = ThisIbmScreen.MoveCursorTo1(Point.row, (Point.column + 14))
     
    End Sub
    Sub CutAndPaste()
     
        Dim text As String
        
        Dim field As HostField
        
        Dim rcode As ReturnCode
     
        ThisIbmScreen.SetSelectionStartPos 1, 29
        
        ThisIbmScreen.ExtendSelectionRect 1, 48
        
        ThisIbmScreen.Cut
        
        rcode = ThisIbmScreen.MoveCursorTo1(5, 19)
        
        ThisIbmScreen.Paste
        
    End Sub
    See Also