Clearing an Array
- From: "Cloudfall" <SydneyCloudfall@xxxxxxxxxxx>
- Date: 16 Mar 2006 21:56:01 -0800
Hi everyone,
I want to clear the contents of an array. I know that redimensioning an
array also clears it. So, I decided to clear the array by
redimensioning to zero and then re-redimensioning it back to what it
was. So, I wrote the following:
Sub test()
Static vDlt(1 To 52) As Boolean
ReDim vDlt(0) As Boolean
ReDim vDlt(1 To 52) As Boolean
End Sub
When I run this I get the error message "Compile error: array already
dimensioned". Microsoft help has this to say on the issue:
"You can use the ReDim statement repeatedly to change the number of
elements and dimensions in an array."
Does anybody know what is going on here? Also, is there a more elegant
way of clearing the array?
Thank you now for any responses but I will always get back to you with
feedback.
Regards,
Terry.
.
- Follow-Ups:
- Re: Clearing an Array
- From: Dave Peterson
- Re: Clearing an Array
- From: Cloudfall
- Re: Clearing an Array
- Prev by Date: Re: how to transform string ( include only numbers ) to number
- Next by Date: Re: Clearing an Array
- Previous by thread: Re: how to transform string ( include only numbers ) to number
- Next by thread: Re: Clearing an Array
- Index(es):
Relevant Pages
|