QBasic 1.1: DIM Statement


DIM [SHARED] variable[(subscripts)] [AS type] [,variable[(subscripts)] [AS type]]...
REDIM [SHARED] variable(subscripts) [AS type] [,variable(subscripts) [AS type]]...

Description / Parameter(s)

SHARED Specifies that variables are shared with all SUB or FUNCTION procedures in the module.
variable The name of an array or variable.
subscripts Dimensions of the array, expressed as follows:
[lower TO] upper [,[lower TO] upper]...
lower The lower bound of the array's subscripts. The default lower bound is zero.
upper The upper bound.
AS type Declares the data type of the array or variable (INTEGER, LONG, SINGLE, DOUBLE, STRING, or a user-defined data type).
DIM declares either static or dynamic arrays. Unless array storage has been determined by $STATIC, $DYNAMIC, or COMMON, arrays dimensioned with numbers are static and arrays dimensioned with variables are dynamic. REDIM always declares dynamic arrays.
Static array storage is allocated when you start a program and remains fixed. Dynamic array storage is allocated while a program runs.


' $DYNAMIC DIM A(49, 49) REDIM A(19, 14)