Record MyRecordPart type basicRecord
10 myInt INT[5];
10 myChar CHAR(1);
end
myRecord MyRecordPart;
call MyProgram( myRecord.myInt[*] );
The bracketed asterisk ([*]) means “treat the preceding variable as a structure field array.” If you specify myRecord.myInt, without the brackets, the program receives only the first element in the array, as if you coded myRecord.myInt[1].
Program MyProgram type BasicProgram ( myInt INT[5]! )
end
The exclamation point indicates that the preceding variable is a structure field array rather than a dynamic array that can be re-sized in the called program. The array size and exclamation point are required after each array dimension.
Record X type BasicRecord
10 myChar CHAR(4)[2];
20 mySubChar01 char(2);
20 mySubChar02 char(2);
end
When you pass mySubChar01 or mySubChar02 array, the fields are passed in a contiguous block of memory even though the fields are not stored contiguously. The data must be copied, and the extra processing takes time.
For details on how multidimensional structure field arrays are stored, see “Arrays.”