The findFieldPosition function returns the beginning position of a target field in the host-connected presentation space. This function can be used to find either protected or unprotected fields but only in a field-formatted host presentation space.
Prerequisite Calls
connectPresentationSpace
Call Parameters
Parameter name
|
Explanation
|
type
|
Please see the following table.
|
position
|
Identifies the field within the host presentation space at which to start the Find. It can be the PS position of any byte within the field in which you desire the Find to start.
|
The calling 2-character 'type' parameter can contain:
Code
|
Explanation
|
[RB][RB] or T [RB]
|
This field.
|
P [RB]
|
The previous field, either protected or unprotected.
|
N [RB]
|
The next field, either protected or unprotected.
|
NP
|
The next protected field.
|
NU
|
The next unprotected field.
|
PP
|
The previous protected field.
|
PU
|
The previous unprotected field.
|
Note:
[RB] represents a required blank.
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
|
Relative position of the requested field from the origin of the host presentation space. This position is defined to be the first position after the attribute byte.
|
Return Code
The following values are defined for the 'returnCode' property:
Return Code
|
Explanation
|
0
|
The findFieldPosition function was successful.
|
1
|
Your program is not connected to a host session.
|
2
|
A parameter error was encountered.
|
7
|
The host presentation space position is not valid.
|
24
|
No such field was found.
|
28
|
Field length of 0 bytes.
|
Remarks
1. | This function is equivalent to HLLAPI Function Number 31. |
2. | Except when [RB][RB] or T [RB] is used as 'type' parameter, if the field found is the same as the field from which the Find started, a return code of 24 is returned. |
|