Find Field Length – Function 32
This function determines the length of a specified field in the Host session presentation space. You can use Find Field Length 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(FINDFIELDLENGTH,lpbyString,lpwLength,lpwReturnnCode)
Call parameters
Parameter Description
Data String A 2-byte string that must be one of the following:
[space][space] This (current) field.
T[space] This (current) field.
P[space] Previous field (protected or unprotected).
N[space] Next field (protected or unprotected).
NP Next Protected field.
NU Next Unprotected field.
PP Previous Protected field.
PU Previous Unprotected field.
Data Length NA (length of 2 is implied).
PS Position The position in the Host session presentation space where the find starts.
Return parameters
Parameter Description
0 If Return Code = 28, the field length is zero. If Return Code = 24, the Host session presentation space is unformatted.
>0 Starting position of the requested field.
Return code
Code Description
WHLLOK The search string was found.
WHLLNOTCONNECTED Your Windows HLLAPI application is currently not connected to a session.
WHLLPARAMETERERROR One or more of the call parameters are invalid.
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.
WHLLZEROLENFIELD The specified field has a length of zero.
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.
5250 emulators supports a Presentation Space of 24 rows by 80 columns. When an error message from the host or when the operator presses the SysReq key, a 25th row is displayed. When the row 25 is displayed, it is a valid area for this function.