Hashtable: Item (set)

Item

Sets the value associated to the specified key.

 Public Property Set Item(
	  ByRef Key As Variant,
	  ByRef Value As Variant )

Parameters

Key
[ByRef] Variant. The key used to look up a value.
Value
[ByRef] Variant. The value to associate with the key.

Remarks

If the key is not found, then the key/value are added to the table. If the key IS found, then the associated value with the key is replaced with the new value.

The key can be any datatype other than vbUserDefinedType. If an object is being used as a key, then it should implement the IObject interface to allow for custom hashcode creation. If the object does not implement the interface, then the objects memory location is used for a hashcode. If two different objects should represent the same hashcode, then they need to implement the IObject interface and override the GetHashCode function.

Read/Write.

See Also

Project VBCorLib Overview | Class Hashtable Overview