Top  Previous  Next


The searchPresentationSpace function lets your hllapi.js program examine the host presentation space for the occurrence of a specified string.







Prerequisite Calls





Call Parameters


Parameter name



Target string for search.


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').


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



A numeric code indicating the execution status of the function. Please refer to the Return Code table below for all possible values.


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



The searchPresentationSpace function was successful.


Your program is not connected to a host session.


The search string was not found.




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.