bas7advr.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 Details
  Syntax  Details  Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
ERASE reinitializes the elements of static arrays and deallocates dynamic
arrays.
 
ERASE arrayname [,arrayname]...
 
Usage Notes
    ■ ERASE sets the elements of an array as follows:
 
      Type of array                  ERASE sets array elements set to
      ════════════════════           ═════════════════════════════════
      Numeric static array           Zeros.
      String static array            Null strings ("").
      Array of records               Zeros--all elements of each word,
                                     including fixed-string elements.
 
   ■ Using ERASE on a dynamic array frees the memory used by the array.
     Before your program can refer to the dynamic array again, it must
     first redeclare the array's dimensions with a DIM or REDIM statement.
     If you redeclare the array's dimensions with a DIM statement without
     first erasing it, BASIC generates the run-time error message, "Array
     already dimensioned." The ERASE statement is not required when
     dimensions are redeclared with REDIM.