clearing an array

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

this seems like it should be easy, but a couple of things aren't working.

if you have declared an array:

dim arParameters() as string

and then later defined it:

redim arParameters(1,2) as string

how can you clear it out? Sort of like an UNdim ? Not just redefine it to
another value, but put it back in the state it was in in the first place,
right after the

dim arParameters() as string

??
 
this seems like it should be easy, but a couple of things aren't working.
if you have declared an array:

dim arParameters() as string

and then later defined it:

redim arParameters(1,2) as string

how can you clear it out? Sort of like an UNdim ? Not just redefine it
to
another value, but put it back in the state it was in in the first place,
right after the

dim arParameters() as string

Use the Erase statement...

Erase arParameters

You might want to look it up in the help files as it works "differently" for
dynamic as opposed to fixed arrays and what happens depends on the data type
of the array.

Rick
 
Thanks!

I will look it up.

'Erase' ... almost like English.

Thanks again.
 
Thanks, Rick, that worked fine.

The problem I was having was that two variables that I thought would be
totally out of scope and gone away when the code terminated, did not.

But, I've reset the one in the code now, and the Erase statement that you
suggested has taken care of that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top