Copy Field to String – Function 34
This function copies the contents of a specified field in the Host session presentation space to a string. You can use Copy Field to String for either protected or unprotected fields.
Prerequisite functions
Connect Presentation Space (function 1)
Function call
WinHLLAPI(COPYFIELDTOSTRING,lpbyString,lpwLength,lpwReturnnCode)
Call parameters
Parameter Description
Data String Buffer to hold the copied field. If session option EAB is set, must be defined at least twice the length of the field to be copied
Data Length Number of characters to copy.
PS Position The position in the Host session presentation space of the field to be copied. This value may be any byte within the field, since the copy always starts at the beginning of the field.
Return parameters
Parameter Description
Data String Data copied from the specified field. The first byte of Data String is the first byte in the specified field.
Return code
Code Description
WHLLOK The specified field was copied successfully.
WHLLNOTCONNECTED Your Windows HLLAPI application is currently not connected to a session.
WHLLPARAMETERERROR One or more of the call parameters are invalid.
WHLLTRUNCATED The specified field was copied, but the data to be copied and Data String were not the same size. If Data String is smaller than the specified field, the remaining copy data is truncated.
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.