A Hashtable object represents a collection of values (of type Object) that are indexed by objects called keys (also of type Object). We can also think of a hash table as containing key/value pairs.
Identification of the location of elements in a hash table is done using a hashing function. Simply put, a hashing function is a function that assigns a location in the hash table to each element, based on the element’s value. This is not the place to go into any detail about hashing. It is worth mentioning that hash tables can be very efficient structures for storing and retrieving elements. However, there is no “best approach” to defining hashing functions, and so only experimentation can determine whether this particular implementation of a hash table is efficient in any given case.
Note that the Hashtable class is more flexible than the Collection class of the Microsoft.VisualBasic namespace.
Hashtable class members marked with a plus sign (+) are discussed in detail in their own entries.
The following example illustrates most of the members that we will discuss:
Private Sub DoHashtable( ) Dim i As Integer Dim s( ...