qbasic.hlp (Topic list)
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, $DYNAMIC Metacommands
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Set the default array storage.
 
{REM | '} $STATIC
{REM | '} $DYNAMIC
 
    ■ {REM | '}    REM or a remark character (') must precede metacommands.
    ■ $STATIC      Specifies that arrays declared in subsequent DIM
                   statements are static arrays (unless they are declared in
                   a non-static SUB or FUNCTION procedure). Array storage is
                   allocated when you start the program, and remains fixed.
    ■ $DYNAMIC     Specifies that arrays declared in subsequent DIM
                   statements are dynamic arrays. Array storage is allocated
                   dynamically while the program runs.
 
    ■ DIM and REDIM usually provide a better way to specify whether arrays
      are dynamic or static.
 
See Also    DIM, REDIM    REM    SHARED, STATIC