This function returns an element of an object array.
It is equivalent to the JNI function GetObjectArrayElement. However, it also offers the option of obtaining strings instead of string objects.
Call
CALL 'JCI_GetObjectArrayElement' USING aObj index res
aObj | Array object |
index | Array index |
res | Result description |
Arguments
aObj | Data field of the type |
index | Data field of the type |
res | A structure of the form |
Return value (RETURN-CODE)
JCI-RET-OK
The call was successful.
JCI-RET-ENOVM
No Java VM has been started.
JCI-RET-ENULLOBJ
aObj is JCI-NULL.
JCI-RET-EARGUMENT
aObj is not an array object.
JCI-RET-ERESVERS
The statically generated version number in res is invalid (possibly overwritten).
JCI-RET-ERESTYPE
The value of the ResType field is invalid.
JCI-RET-ERESCONV
An error occurred while the element was being converted.
The ResErrCode field contains a more precise error code.
JCI-RET-EINDAOB
index is less than 1 or greater than the number of elements in the array.
Example
DATA DIVISION. WORKING-STORAGE SECTION. COPY JCI-TYPEDEFS. 01 JCIConstants. COPY JCI-CONST. ... 01 arrayObj TYPE JCI-object. 01 arrayIndex PIC S9(9) COMP-5. 01 natText. 05 nlen PIC S9(9) COMP-5 VALUE 80. 05 ntxt PIC N(80) VALUE SPACE. ... 01 MethodRes. COPY JCI-METHODRES. ... PROCEDURE DIVISION. MOVE 7 TO arrayIndex SET RES-NAT-STRING TO TRUE SET ResValAddr TO ADDRESS OF natText CALL 'JCI_GetObjectArrayElement' USING arrayObj arrayIndex MethodRes IF RETURN-CODE NOT = JCI-RET-OK ... END-IF. DISPLAY FUNCTION DISPLAY-OF(ntxt(1:nlen)) UPON T ...