Search Field – Function 30
This function searches a field in the Host session presentation space for the specified string. You can use Search Field for either protected or unprotected fields but only in a field-formatted host presentation space.
Prerequisite functions
Connect Presentation Space (function 1)
Function call
WinHLLAPI(SEARCHFIELD,lpbyString,lpwLength,lpwReturnnCode)
Call parameters
Parameter Description
Data String String to search for.
Data Length Length of the search string. NA if session option EOT is specified.
PS Position Position in the Host session presentation space of the field to search. If session options SRCHFROM and SRCHFRWD are set, indicates position to search from. If session options SRCHFROM and SRCHBKWD are set, indicates position to search to. If session option SRCHALL is set, can be the position of any byte in the field to search.
Return parameters
Parameter Description
0 The search string was not found.
>0 The search string was found. Value is the Host session presentation space position where the string begins.
Return code
Code Description
WHLLOK The search string was found.
WHLLNOTCONNECTED Your Windows HLLAPI application is currently not connected to a session.
WHLLPARAMETERERROR Data String was length zero or greater than the Host session presentation space size.
WHLLPOSITIONERROR Invalid value specified for PS Position.
WHLLSYSERROR The function failed due to a system error.
WHLLNOFIELD The search string was not found, or the Host session presentation space is unformatted.
Remarks
Position in the Host session presentation space is determined by starting in the upper left corner of the screen display (row 1, column 1). At the end of each screen display row, the next Host session presentation space position is column 1 of the following screen display row. This process continues until the end of the Host session presentation space (screen display) is reached.