SysLib.size(arrayName anyArray in) returns (result INT)
The item to which the value is returned must be of type INT or the following equivalent: type BIN with length 9 and no decimal places.
If the array name (arrayName) is in a substructured element of another array, the returned value is the number of occurrences for the structure item itself, not the total number of occurrences in the containing structure (see Examples section).
The array name may be qualified by a package name, a library name, or both
An error occurs if you reference an item or record that is not an array.
// Calculate the sum of an array of numbers sum = 0; i = 1; myArraySize = SysLib.size(myArray); while (i <= myArraySize) sum = myArray[i] + sum; i = i + 1; end
Record myRecordPart 10 siTop CHAR(40)[3]; 20 siNext CHAR(20)[2]; end
Given that you create a record based on myRecordPart, you can use SysLib.size(siNext) to determine the occurs value for the subordinate array:
// Sets count to 2 count = SysLib.size(myRecord.siTop.siNext);
Related concepts
Syntax diagram for EGL functions
Related reference
Arrays
EGL library SysLib