Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

JCI_GetObjectArrayElement

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 JCI-object
Array object whose element is to be returned.

index

Data field of the type JCI-size
Position of the element in the array which is to be returned (beginning with 1).

res

A structure of the form MethodRes
Return value and error information (see section "Arguments and event values of Java methods").
The only permissible values for ResType are RES-OBJECT, RES-ANUM-STRING, and RES-NAT-STRING. If the array element is a NULL object, the length field of the target structure is set to 0 for the types RES-ANUM-STRING and RES-NAT-STRING, and the text area remains unchanged.


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