CoreClasses Xojo Plugin

PrefixDictionaryCaseInsensitive.Lookup Method

Looks up value of a Key and Returns its value Variant or default value if key was not found.

Lookup(
   key as String,
   defaultValue as Variant) as Variant

Parameters

key
The key to lookup.
defaultValue
The default value to use if key was not found.

Returns

Variant
The value of the requested key or defaultValue if the key was not found.

Remarks

The Lookup function is encoding-sensitive. In this version of the dictionary the key is case insensitive.


var d As new EinhugurCollections.PrefixDictionary()
d.Value("Can") = "Can"
d.Value("Canister") = "Canister"
d.Value("Car") = "Car"
d.Value("Cart") = "Cart"

var a As Variant = d.Lookup(“car"), "Some default value")



Notice in the example that it can in this version of the class find the car even if it is not same casing.

See Also

PrefixDictionaryCaseInsensitive Class