Empty Array

Empty Array

Anonymous
Not applicable
471 Views
5 Replies
Message 1 of 6

Empty Array

Anonymous
Not applicable
Is it possible to set an array back to an empty state? By this I mean the state it 's in when created like this: Dim Ranges() As Variant Thanks, Dale
0 Likes
472 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Got it. "Erase". "Dale Levesque" wrote in message news:41a50053$1_1@newsprd01... > Is it possible to set an array back to an empty state? By this I mean the > state it 's in when created like this: > > Dim Ranges() As Variant > > Thanks, > > Dale > >
0 Likes
Message 3 of 6

Anonymous
Not applicable
would ReDim Ranges(0) do that? or ReDim Ranges() ? don't know if it would or why you'd need to do that but it's an interesting question. "Dale Levesque" wrote in message news:41a50053$1_1@newsprd01... > Is it possible to set an array back to an empty state? By this I mean the > state it 's in when created like this: > > Dim Ranges() As Variant > > Thanks, > > Dale > >
0 Likes
Message 4 of 6

Anonymous
Not applicable
> would ReDim Ranges(0) do that? Nope. That would be an array with one element. > or ReDim Ranges() ? Nope. Thats improper syntax. Erase Ranges works fine. The reason I need it empty is because I check inside a loop whether the array has been instantiated or not. Another good reason to start using collections I suppose. Best regards, Dale "MP" wrote in message news:41a50293$1_2@newsprd01... > would ReDim Ranges(0) do that? > or ReDim Ranges() ? > don't know if it would or why you'd need to do that but it's an interesting > question. > > "Dale Levesque" wrote in message > news:41a50053$1_1@newsprd01... > > Is it possible to set an array back to an empty state? By this I mean the > > state it 's in when created like this: > > > > Dim Ranges() As Variant > > > > Thanks, > > > > Dale > > > > > >
0 Likes
Message 5 of 6

Anonymous
Not applicable
sorry didn't see your repost before i posted those dumb thoughts! :-) Glad you got it. "Dale Levesque" wrote in message news:41a50dfd_2@newsprd01... > Erase Ranges works fine. The reason I need it empty is because I check > inside a loop whether the array has been instantiated or not. Another good > reason to start using collections I suppose. amen to that! :-) unless i'm handed an array and have to deal with it, GetAttributes, Split etc - well you just gotta deal with the array, but otherwise ....i never create one anymore since learning about collections. I think there may be some very specialized situations where arrays are computationally more efficient but for anything I write it's insignificant. ...but then ...with anything i write, what isn't? :-)
0 Likes
Message 6 of 6

Anonymous
Not applicable
"Dale Levesque" wrote in message news:41a50235_3@newsprd01... > Got it. "Erase". Thanks for posting your solution, Dale. I really hate it when folks post back that they 'found it' without letting others know what 'it' was. 😉
0 Likes