Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"clear multidimensional array

Status
Not open for further replies.

magmo

Programmer
May 26, 2004
291
SE
Hi

I have this code....

Code:
Dim arrMyArray(,) As Integer    ' No bounds yet.
ReDim arrMyArray(iCounter, 6)          ' Give it bounds.

If I only want to "clear" the values that the array has been assigned to it, how would I do that?


Regards
 
Correct me if I'm wrong, but I don't believe the .clear method works on multidimensional arrays.

To just clear the data and keep the bounds, see if this is what you are looking for.
:) -Andrew
Code:
dim row, col as integer
row = ubound(arrMyArray,2)
col = ubound(arrMyArray,1)

redim arrMyArray(col, row) ' keeps bounds
redim arrMyArray(-1)       ' does not keep bounds
' in both cases, data is cleared.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top