Hashtable: ContainsKey

ContainsKey

Checks if the current instance contains a specific key.



 Public Function ContainsKey(
	  ByRef Key As Variant ) As Boolean

Parameters

Key
[ByRef] Variant. The key to check for.

Return Values

Boolean -  Indicates if the key was found.

Remarks

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 doesnt 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.

See Also

Project VBCorLib Overview Class Hashtable Overview Hashtable Properties Hashtable Methods Contains ContainsValue