From Xojo Documentation

Revision as of 22:31, 17 July 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Dictionary.Lookup(Key As Variant, defaultValue As Variant) As Variant

Supported for all project types and targets.

Looks up the passed value of Key. Returns a Variant.


If Key is found, it returns the corresponding value. If Key is not found, it returns the passed defaultValue.

Sample Code

This example looks up the passed color in the Dictionary.

Var d As New Dictionary
d.Value(RGB(255, 0, 0)) = "This is pure red."
d.Value(RGB(0, 255, 255)) = "This is pure cyan."

Var a As Variant
a = d.Lookup(RGB(255, 0, 0), "Default color")