Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Static and Dynamic Arrays Details
◄Summary► ◄Details► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Usage Notes
■ The following syntax gives general guidelines for declaring cross-module
(global), module-level, and local arrays:
• Cross-module dynamic arrays
'$DYNAMIC ' a, b can be variables, numeric,
COMMON [SHARED] X() AS INTEGER ' or symbolic constants
DIM X(a,b) AS INTEGER
• Cross-module fixed size arrays
'$STATIC ' a, b must be numeric or
DIM X(a,b) AS INTEGER ' symbolic constants
COMMON [SHARED] X() AS INTEGER
• Module-level dynamic arrays
DIM [SHARED] X(a,b) AS INTEGER ' a, b must be variables
' or
'$DYNAMIC ' a, b can be variable, numeric,
DIM [SHARED] X(a,b) AS INTEGER ' or symbolic constants
' or
REDIM [SHARED] X(a,b) AS INTEGER
• Module-level fixed-size arrays
'$STATIC ' a, b must be numeric or
DIM SHARED X(a,b) AS INTEGER ' symbolic constants
• Local dynamic arrays (in a non-static procedure)
'$DYNAMIC
DIM [SHARED] X(a,b) AS INTEGER ' a, b can be variable, numeric,
or ' or symbolic constants
REDIM [SHARED] X(a,b) AS INTEGER
or
STATIC x() AS INTEGER
DIM X(a,b) AS INTEGER
• Local dynamic arrays (in a static procedure)
'$DYNAMIC
DIM X(a,b) AS INTEGER ' a, b can be variable, numeric,
or ' or symbolic constants
REDIM X(a,b) AS INTEGER
or
STATIC x() AS INTEGER
DIM X(a,b) AS INTEGER
• Local fixed-size arrays (in a static procedure)
'$STATIC
DIM X(a,b) AS INTEGER