Copy String to Field – Function 33
This function copies a string into the specified field in the Host session presentation space.
Prerequisite functions
Connect Presentation Space (function 1)
Function call
WinHLLAPI(COPYSTRINGTOFIELD,lpbyString,lpwLength,lpwReturnnCode)
Call parameters
Parameter Description
Data String String to copy to the specified field.
Data Length Number of characters. NA if session option EOT is specified.
PS Position The position in the Host session presentation space of the field to copy Data String to. This value can be any byte within the field, since the copy always starts at the beginning of the field.
Return code
Code Description
WHLLOK The search string was copied successfully.
WHLLNOTCONNECTED Your Windows HLLAPI application is currently not connected to a session.
WHLLPARAMETERERROR Data Length invalid (set to zero).
WHLLINHIBITED The specified field is protected, or attempted to copy invalid data (such as a field attribute).
WHLLTRUNCATED The string was copied successfully, but one or more characters were truncated.
WHLLPOSITIONERROR Invalid value specified for PS Position.
WHLLSYSERROR The function failed due to a system error.
WHLLNOFIELD 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.
This function is affected by the session options STRLEN/STREOT, EOT=c and EAB/NOEAB. See Set Session Parameters (function 9) for details on these session options.