hashTable.RemoveAll

  • Thread starter Thread starter msnews.microsoft.com
  • Start date Start date
M

msnews.microsoft.com

So what is the best way to iterate through the hash table to remove all the
members?

i tried using the enumerator but it gets an exception as it removes each
element.

dim de as dictionaryEntry
for each de in xHashTable
xHashTable.remove(de.key)
next

I am missing the vb6 scripting.dictionary.removeall.

Thanks,
jeff
 
Isn't there a clear() method? xHashTable.clear

There is no real need to remove as you go through and process each.
 
* "msnews.microsoft.com said:
So what is the best way to iterate through the hash table to remove all the
members?

Call the hashtable's 'Clear' method. You cannot manipulate the
hashtable when enumerating it with 'For...Each'.
 

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