Locates a field that matches the specified field attributes, starting from the specified row and column.
Parameters
- startRow
- Start row position.
- startColumn
- Start column position.
- fieldtype
- The type of field.This is a FieldType Enumeration value that specifies the type of field (protected, unprotected, or any) to search for.
- findoption
- A FindOption enumeration value that specifies the direction to search.
Return Value
If a field is found, a
HostField object is returned. is returned. If no field is found, nothing is returned.
When the mouse is clicked, this sample gets the mouse location and searches from that point to find the next unprotected field. Then it moves the cursor to that field. To run this sample, open any IBM3270 session and copy the code into the ThisIbmScreen code window. On the VBA editor View menu, choose Immediate window. Then click on various screen locations.
Private Sub IbmScreen_MouseClickEx(ByVal windowMessage As Long, ByVal row As Long, ByVal column As Long, ByVal x As Long, ByVal y As Long)
Dim field As HostField
Dim rtrnCode As ReturnCode
'Print the row and column the mouse was clicked on
Debug.Print "row = " & row & " and column = " & column
Set field = ThisIbmScreen.FindField3(row, column, FieldType_Unprotected, FindOption_Forward)
'Print the starting row and column of the next unprotected field
Debug.Print "Row of next field= " & field.StartRow & " Column of next field = " & field.StartColumn
ThisIbmScreen.Wait (2000)
'Go to the next unprotected field
rtrnCode = ThisIbmScreen.MoveCursorTo1(field.StartRow, field.StartColumn)
MouseClickEx = True
End Sub