Name

Erase Statement

Syntax

Erasearraylist
arraylist

Use: Required

Data Type: String literal

A list of array variables to clear

Description

Releases an array object. This is equivalent to setting the array variable to Nothing.

Rules at a Glance

  • Specify more than one array to be erased by using commas to delimit arraylist.

  • The Erase statement causes all memory allocated to arrays to be released.

Programming Tips and Gotchas

Once you use Erase to clear an array, it must be redimensioned with ReDim before being used again. This is because Erase releases the memory storage used by the array.

Get VB .NET Language in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.