DIM(


General Form:

  1. DIM(array-name, dimension)

  2. DIM(field)
Where:
array-name = numeric array name, alpha array name or field array name.

dimension = 1 or 2 (also 0 for string arrays)

field = numeric or string field

The DIM( function returns the current size of the specified dimension of an array. A value of zero will be returned if the second dimension of a one-dimensional array is requested. The DIM( function is valid wherever a numeric expression is legal.

Starting with KCML6.10, the DIM() function may also be used with numeric or string values to determine the occurs value of the field. This will be one if no occurs is specified. For instance, if .a is (1, "DATE") and .b is (2, "DATE*5"), then DIM(.a) will be 1 and DIM(.b) will be 5.

Starting with KCML6.60 the dimension of 0 can also be specified for string arrays and returns the length of an individual element. This will work event if the array has no elements (such as DIM a$(0)_record_type)

Syntax examples:

FOR loop = 1 TO DIM(record(),2)
size = DIM(flow(),1) * 2

See also:

DIM, COM, LIST DIM, and the field operators POS, LEN() and PACK().