Link to home
Start Free TrialLog in
Avatar of cdb424ttm
cdb424ttm

asked on

redim vs. erase what is the difference

redim vs. erase what is the difference?
I’m having a hard time understanding what the difference between using erase or redim to clear out an array. Can some one fill me in on the pros and Con’s of it?

Thanks
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

redim can't be used with static arrays.

erase will completely delete a variable arrays and will only reset values of static arrays.
ya redim will remove memory (without the preserve)
erase will also do
i am not sure what will be the difference in terms of "freeing memory" speed for hugh arrays.
if i am not wrong, i guess redim is faster.
perhaps emoreau can comment on this.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>if i am not wrong, i guess redim is faster.
>>perhaps emoreau can comment on this.

I have no idea on this.