Locates a field that matches the specified field length, starting from the specified row and column.
expression.FindField2( _
ByVal As Integer, _
ByVal startColumn As Integer, _
ByVal As Integer, _
ByVal As FindOption _
) As HostField object
where
expression is a variable that represents a
IbmScreen Object
Parameters
- startRow
- Start row position.
- startColumn
- Start column position.
- fieldLength
- Length of the field.
- findoption
- A FindOption enumeration value that specifies the direction to search.
Return Value
If a field is found, a
HostField object is returned. If no field is found, nothing is returned.
When the mouse is clicked, this sample finds the next field that is 8 characters long and 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. If your screen doesn't doesn't have a field that is 8 characters long, change the field length parameter in the code to match a field length on the screen.
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.FindField2(row, column, 8, FindOption_Forward)
'Print the starting row and column of the next field that is 8 characters long
Debug.Print "Row of next field = " & field.StartRow & " Column of next field = " & field.StartColumn
ThisIbmScreen.Wait (2000)
'Go to the next field
rtrnCode = ThisIbmScreen.MoveCursorTo1(field.StartRow, field.StartColumn)
MouseClickEx = True
End Sub