ERASE Statement ---------------------------------------------------------------------------- Action Reinitializes the elements of static arrays; deallocates dynamic arrays. Syntax ERASE arrayname -, arrayname-... Remarks The arrayname arguments are the names of arrays to erase. It is important to know if this array is static or dynamic. ERASE sets the elements of an array as follows. ----------------------------------------------------------------------------- If type of array is. ERASE sets array elements to. ---------------------------------------------------------------------------- Numeric static array Zeros. String static array Null strings (""). Array of records Zeros [mdash] all elements of each record, 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 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. See Also CLEAR, DIM, REDIM Example The following example shows the use of ERASE with the $DYNAMIC and $STATIC metacommands. REM $DYNAMIC DIM A(100, 100) ' Deallocate array A. ERASE A ' Redeclare dimensions for array A. REDIM A(5, 5) REM $STATIC DIM B(50, 50) ' Set all elements of B equal to zero. (B still has the dimensions ' assigned by DIM.) ERASE B