Specifications

Commands - 31
DIM
Statement
SYNTAX: DIM variable (value) [,variable (value)] . . .
PURPOSE: To specify the maximum size for array variables and reserve memory accordingly.
REMARKS: The DIM statement sets all elements of the specified numerical arrays to an initial value of zero.
String array elements are of variable length, with an initial value of zero (null).
The default value is 11 for numerical values and 253 for strings. This means that the numerical array
subscripts for 0 to 10 are allowed. The number of subscripts is always one more than the dimension.
The maximum number of dimensions for an array is 255.
NOTE: When CLEAR is executed, all dimensioned arrays are redimensioned to 11 (0–10).
NOTE: String arrays are single dimension only.
Unlike scalar variables, dimensioned array names use only the first and last letters. A variable name
PUMP(n) is seen as the same as PP(n) and returns the same number.
EXAMPLE: The following dimensions a single dimension numeric and string array:
10 DIM A(25), A$(30)
The following dimensions a numeric array with three dimensions:
20 DIM B(10,10,10)
ERROR: <Out of memory> – if dimensioned space exceeds memory
<Data negative> – if value is negative
<Array already dimensioned> – if an attempt is made to redimension an array or dimension an
array that has already been referenced in the execution path