I want to walk through a hashtable, value by value. This is usually how I do it (assuming my key is a String, which is usually is, at least for me):<br><br>for (Enumeration e = myHash.keys(); e.hasMoreElements() {<br> String key = e.nextElement().toString();<br> Object value = myHash.remove(key);<br> /* ...do stuff... */<br>}<br><br>The problem is, that leaves me with an empty Hashtable. I'd like to use <FONT FACE=monospace>myHash.get(key)</font>, but that would create an infinite loop as <FONT FACE=monospace>e.hasMoreElements()</font> would always be true. Is there another better way to walk through a hashtable (without leaving an empty hashtable)? Or do I have to create a seperate method that will throw the results into a new hashtable and then pass the new one back by reference? Is there something better than <FONT FACE=monospace>e.hasMoreElements()</font>? Thanks for any help.. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence."
light the world, and bring depth to the silence."