• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

erase data inside an array

hi,

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

Thanks.
0
RyanBank
Asked:
RyanBank
  • 3
2 Solutions
 
basicinstinctCommented:
Use this command (where arr is the name of your array):

Erase arr
0
 
Guy Hengel [angelIII / a3]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>

0
 
basicinstinctCommented:
Here's website that talks about the Erase command: http://www.html.dk/dokumentation/vbscript/HTML/vsstmErase.htm#vsstmerase

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

arr = Nothing


0
 
basicinstinctCommented:
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.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now