Fujitsu J Adapter Class Generator User Manual page 68

Fujitsu user's guide j adapter class generator
Table of Contents

Advertisement

68
Chapter 5. Adapter Class Reference
...
REPOSITORY.
CLASS JA-2-INT AS "JA-2-int"
CLASS JA-1-INT AS "JA-1-int"
...
01
anArray
01
wArray
...
INVOKE JA-2-INT "NEW-ARRAY" USING n RETURNING anArray.
PERFORM VARYING I FROM 0 BY 1 UNTIL I >= n
INVOKE JA-1-INT "NEW-ARRAY" USING m RETURNING wArray
INVOKE anArray "SET-ARRAY-ELEMENT" USING I wArray
END-PERFORM.
SET wArray TO NULL.
1. A two-dimensional array object of int is generated (number of elements = n).
2. A one-dimensional array object of int is generated (number of elements = m).
3. The one-dimensional array generated in [2] is set in each element of the first
dimension of anArray.
GET-ARRAY-LENGTH method (object method)
Explanation
This method returns the number of elements of an array object.
Syntax
anObject
INVOKE
Parameter and return value
anObject
Specifies the array object from which the number of elements is obtained.
elmNum (attribute: PIC S9(9) COMP-5)
Returns the number of elements of an array.
GET-ARRAY-ELEMENT method (object method)
Explanation
This method fetches an element from an array object.
Syntax
anObject
INVOKE
Parameter and return value
anObject
Specifies the array object from which an element is to be fetched.
inx (attribute: PIC S9(9) COMP-5)
Specifies the subscript of the element to be fetched. The subscript begins
from 0.
elemValue (attribute: Array element type)
Returns the value of the array element fetched.
OBJECT REFERENCE JA-2-INT.
OBJECT REFERENCE JA-1-INT.
"GET-ARRAY-LENGTH" RETURNING
"GET-ARRAY-ELEMENT" USING inx RETURNING
[1]
[2]
[3]
elmNum
elemValue

Advertisement

Table of Contents
loading

Table of Contents