erase data inside an array


Please assist how can we erase the data and elements inside an array?

Who is Participating?
basicinstinctConnect With a Mentor Commented:
Use this command (where arr is the name of your array):

Erase arr
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
the ERASE completely removes the array.

if you use the following, you empty all the array values:
REDIM yourarray(<size>) as <data type>

Here's website that talks about the Erase command:

By the way, if you totally want to kill the array you can use this command:

arr = Nothing

Well, to clarify Angel's comment

Erase only completely removes dynamic arrays.  In the case of static arrays it empties all of the data values (sets them to default for that data type).
Also, I do believe you can only use redim on a dynamic array.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.