$ArrSize: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (Mlarocca moved page $ARRSIZE to $Arrsize: Lower case change)
(No difference)

Revision as of 12:17, 7 July 2014

The $ARRSIZE function returns the number of elements in a particular dimension of a named array. This function is useful for users who pass entire arrays as parameters to a subroutine and then must know the size of the array supplied as the actual argument. For more information about passing arrays to a subroutine, refer to Index loops.

Syntax

The format of the $ARRSIZE function is:

$ARRSIZE (name, dimension)

where:

  • name is a string that specifies the name of an array.
  • dimension is a number that indicates the dimension of the named array for which the number of elements should be returned. Dimension can contain an expression whose value is 1, 2, or 3.

Example

FOR %I FROM 1 TO $ARRSIZE ('%COMM.ARRAY',1)

causes %I to iterate from 1 to the number of elements in dimension 1 of the array %COMM.ARRAY.