Moves the cursor to the specified screen location.
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. |
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:
- Create a 3270 session and set the Host name / IP address to demo:ibm3270.sim.
- Then log in with any credentials, and enter "ispf" on the next screen.
- 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