hello,
i have a hashTable of which values are needed to be reset. i've tried using the DictionaryEntry to iterate through each element in the hashTable and setting their values to 0, but it seems that it doesn't work.
-
For Each item As DictionaryEntry In hashQty
-
item.Value = 0
-
Next
-
afer the code above is executed, the value of each element in hashQty is not 0.
Thank you
Try putting item after Next so it looks like this;
-
For Each item As DictionaryEntry In hashQty
-
item.Value = 0
-
Next item
-
Because if you don't put that, I don't think it loops through all of them.
Here's the example from MSDN's
Hashtable Class page.
- For Each de as DictionaryEntry In myHashtable
-
...
-
Next de
Notice the Next de on the 3rd line...
joedeene