$STATIC, $DYNAMIC Metacommands ---------------------------------------------------------------------------- Action Set aside storage for arrays, while program is either compiling ( $STATIC) or running ( $DYNAMIC). Syntax REM $STATIC '$STATIC REM $DYNAMIC '$DYNAMIC Remarks The $STATIC metacommand sets aside storage for arrays during compilation. When the $STATIC metacommand is used, the ERASE statement reinitializes all array values to zero (numeric arrays) or the null string (string arrays) but does not remove the array. The $DYNAMIC metacommand allocates storage for arrays while the program is running. This means that the ERASE statement removes the array and frees the memory it took for other uses. You also can use the REDIM statement to change the size of an array allocated using $DYNAMIC. The $STATIC and $DYNAMIC metacommands affect all arrays except implicitly dimensioned arrays (arrays not declared in a DIM statement). Implicitly dimensioned arrays are always allocated as if $STATIC had been used. All arrays inside a SUB or FUNCTION procedure are dynamic unless the STATIC keyword is included in the SUB or FUNCTION statement. Example See the ERASE statement programming example, which demonstrates uses of the $DYNAMIC and $STATIC metacommands.