Sign in to follow this  
Followers 0
sshrum

Blast an existing array into nothingness

3 posts in this topic

#1 ·  Posted (edited)

How does one reset an existing array?

Is there a quick way to just zero it out or even destroy it altogether?

TIA

ADDENDUM: I'm blind: REDIM

Edited by sshrum

Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

There are ways to do both. If you want to reset the entire contents of an array to nothing, just Dim it again, with either the same or different dimensions. If you want to completely destroy it, assign a single value to it without using subscripts, like "$array = 0".

EDIT: ReDim is for when you want to keep the original data. It doesn't delete anything unless the new dimensions are smaller than the old.

Edited by Sokko

Share this post


Link to post
Share on other sites

EDIT: ReDim is for when you want to keep the original data. It doesn't delete anything unless the new dimensions are smaller than the old.

<{POST_SNAPBACK}>

Hehe..I just found that out...thanks. :">

Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0