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
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
ERASE arrayname [,arrayname]...
Usage Notes
■ The ERASE statement sets the elements of a static array as follows:
Array Type Element
════════════════ ══════════════════════════════════════════════
Numeric static Zeros
String static Null strings ("")
Array of records Zeros (all elements of each word, including
fixed strings)
■ Using ERASE on a dynamic array frees the memory used by the array.
Before your program can refer to the dynamic array again, you must
reallocate space for the array by redeclaring its dimensions with DIM
or REDIM. For example:
• If you redeclare an array's dimensions with DIM (without first erasing
the array), then Visual Basic generates the run-time error message,
"Array already dimensioned."
• If you redeclare an array's dimensions with REDIM, then the ERASE
statement is not required.
See: ◄DIM Statement► ◄REDIM Statement►