DEFINE ... ARRAY

An array defines a vector variable with a list of elements.

Syntax 1: Static array definition

DEFINE variable ARRAY [ size [,size  [,size] ] ] OF datatype

Syntax 2: Dynamic array definition

DEFINE variable DYNAMIC ARRAY [ WITH DIMENSION rank ] OF datatype

Syntax 3: Java™ array definition

DEFINE variable ARRAY [ ] OF javatype
  1. variable defines the name of the array.
  2. size can be an integer literal or an integer constant. The upper limit is 65535.
  3. rank an be an integer literal of 1, 2, or 3. Default is 1.
  4. datatype can be a data type, a record definition, a user defined type, a built-in class, an imported package class, or a Java class.
  5. javatype must be a Java class or a simple data type that has a corresponding primitive type in Java, such as INTEGER (int), FLOAT (double).