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.
ERASE Statement
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Reinitializes array elements or frees dynamic array storage space.
 
ERASE arrayname [,arrayname]...
 
    ■ arrayname    The name of an array.
 
    ■ For static arrays, ERASE sets each element of a numeric array to zero
      and each element of a string array to null.
    ■ For dynamic arrays, ERASE frees the memory used by the array. You must
      redeclare the array's dimensions with REDIM or DIM before using it.
 
Example:
    DIM a%(0)
    a%(0) = 6
    PRINT "Before: "; a%(0)
    ERASE a%
    PRINT "After: "; a%(0)
 
See Also    CLEAR    DIM, REDIM