<-- Previous || Up || Next -->

Lookup Function
Hash Table Class

Public Function Lookup( _
      ByRef rItem As Variant _
    , ByVal vKey As Variant _
    ) As Boolean

Lookup and return the Item associated with a Key.

Example:
    Assuming
       Dim htTemp As New HashTable
       htTemp.Add "FunctionName", 23
       htTemp.Add "FunctionName", 24
       Dim varData As Variant
       Dim bResult As Boolean
    for example
       bResult = htTemp.Lookup(varData, "FunctionName")
    leaves
       bResult = True
       varData = 24
rItem: The Item that will be returned if the lookup is successful. rItem can be any data type (vbString, numeric, vbDate, vbObject, vbArray, etc.) as long as it is compatible with the Item to be returned. It is frequently wisest to use a Variant since they can accept any type of Item.
vKey: The string or numeric identifier whose Item is to be returned.
Return value: Method returns True if the Key was found and its Item was returned via rItem, and it returns False otherwise.
Note: If there are multiple hash table definitions with the same Key, this method will return the Item from the one that was mostly-recently-added, assuming that the hash table has not been expanded nor contracted.
See also:
    Exists Method
    Remove Method
    Update Method
    Add Method
    AddOrUpdate Method
    Compare Property
v1.3 BugFix: This method has been fixed to support the retrieval of Object and DataObject type Items.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.