Erase

FreeBASIC

Erase
 
Statement to erase arrays

Syntax

Declare Sub Erase ( array As Any [, ... ] )

Usage

Erase( array0 [, array1 ... arrayN ] )

Parameters

array
An array to be erased.

Description

Using Erase on a fixed-length array clears (re-initializes) all elements.

Using Erase on a variable-length array (array already sized) frees the memory used by the element data (does not allow to after resize it with a different number of dimensions).

Example

Dim MyArray1(1 To 10) As Integer
ReDim MyArray2(1 To 10) As Integer 

Erase MyArray1, MyArray2


Differences from QB

  • None

See also