Toshiba KB-80 Computer Keyboard User Manual


 
- 23 -
DIM
Function Specifies the max. number of array elements, and allocates the memory area in the
memory.
Format DIM <variable name> ( <subscript> ) ] ···) [, <variable name> ( <subscript> [,
<subscript> ] ···) ] ···
Term <variable name>: Array variable name
(It should be named according to the usual variable naming
conventions.)
<subscript>: A numeric value or numeric expression indicating the max. value
for the subscript of the array
Explanation A specified area in which the array variable is stored is reserved, and the variable is
initialized at the same time. 0 is assigned to all numeric array variables as an initial
value by executing the DIM statement. Null strings are assigned to a character array
variable. Therefore, the length of the character string is 0.
The max. of 16 dimensions and 32767 elements is available for an array, however,
they are limited according to the memory capacity. In actuality, the maximum will not
be used, since the number of characters which can be included in one line is also
limited. The min. value for subscript is 0.
If an array variable is used without an array declaration by the DIM statement, the
value for subscript is automatically set to 10. In this case, a value higher than 11
cannot be set. If the value for subscript exceeds the specified max. value, an error
occurs.
The array variable declared by the DIM statement can be deleted by the ERASE
statement, and the used memory area is cleared and ready to be used again.