searchPresentationSpace

Top  Previous  Next

 

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

 

connectPresentationSpace

 

 

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

 

1.This function is equivalent to HLLAPI Function Number 6.
2.Four sets of parameters that may be passed in 'params' parameter are related to this function. They are the SRCHALL/SRCHFROM, STRLEN/STREOT, SRCHFRWD/SRCHBKWD, and the EOT=c session options.
3.The searchPresentationSpace function normally checks the entire host presentation space. However, you can use 'params' call 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.
4.The SRCHFROM option is also useful if you are looking for a keyword that might occur more than once in the host presentation space.
5.The searchPresentationSpace function is useful in determining when the host presentation space is available. If your hllapi.js application is expecting a specific prompt or message before sending data, the searchPresentationSpace function allows you to check for a prompt message before continuing.