searchPresentationSpace
The searchPresentationSpace function lets your hllapi.js program examine the host presentation space for the occurrence of a specified string.
| 3270 | 5250 |
|---|---|
| Yes | Yes |
Prerequisite Calls
Call Parameters
| Parameter name | Explanation |
|---|---|
| data | Target string for search. |
| from | Position within the host presentation space where the search is to begin (if SRCHFRWD option set in params) or to end (if SRCHBKWD option set in params). |
| params | An object containing a subset of Session Options parameters, which values will take precedence on the defaults for the execution context of this function. |
Return Properties
| Property name | Explanation |
|---|---|
returnCode |
A numeric code indicating the execution status of the function. Please refer to the Return Code table below for all possible values. |
| position | Should the string been found, it represents the host presentation space position. |
Return Code
The following values are defined for the returnCode property:
| Return Code | Explanation |
|---|---|
| 0 | The searchPresentationSpace function was successful. |
| 1 | Your program is not connected to a host session. |
| 24 | The search string was not found. |
Remarks
-
This function is equivalent to HLLAPI Function Number 6.
-
Four sets of parameters that may be passed in
paramsparameter are related to this function. They are the SRCHALL/SRCHFROM, STRLEN/STREOT, SRCHFRWD/SRCHBKWD, and the EOT=c session options. -
The
searchPresentationSpacefunction normally checks the entire host presentation space. However, you can useparamscall parameter to specify SRCHFROM. In this mode, the calling PS position parameter specifies a beginning or ending point for the search. If the SRCHFRWD option is in effect, the search for the designated string begins at the specified PS position and proceeds toward the end of the host presentation space. If the SRCHBKWD option is in effect, the search for the designated string begins at the end of the PS and proceeds backward toward the specified PS position. If the target string is not found, the search ends at the PS position specified in the calling PS position parameter. -
The SRCHFROM option is also useful if you are looking for a keyword that might occur more than once in the host presentation space.
-
The
searchPresentationSpacefunction is useful in determining when the host presentation space is available. If yourhllapi.jsapplication is expecting a specific prompt or message before sending data, thesearchPresentationSpacefunction allows you to check for a prompt message before continuing.