Implements an hash table whose keys are string and values are Variant
.
NULL
is used when nothing is associated with a given key. Consequently, associating NULL
with a key is the same thing as removing it from the collection.
The size of the internal hash table grows dynamically as data is inserted.
This class is creatable.
DIM hCollection AS Collection hCollection = NEW Collection ( [ Mode AS Integer ] ) |
Mode is the method used for comparing keys:
This class acts like an array.
DIM hCollection AS Collection DIM aVariant AS Variant aVariant = hCollection [ Key AS String ] |
If nothing is associated, then NULL
is returned.
DIM hCollection AS Collection DIM aVariant AS Variant hCollection [ Key AS String ] = aVariant |
If Value is NULL
, then the current value associated with Key is removed from the collection if it exists.
This class is enumerable with the FOR EACH keyword.
DIM hCollection AS Collection DIM aVariant AS Variant FOR EACH aVariant IN hCollection ... NEXT |
Note that elements are enumerated in the order they were inserted. But if you replace the value of an already inserted key, then the order is kept.