Xojo.Core.Dictionary.Lookup

From Xojo Documentation

Revision as of 17:19, 11 August 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Method

Xojo.Core.Dictionary.Lookup(key As Auto, defaultValue As Auto) As Auto

Supported for all project types and targets.

Returns the value associated with the specified key. If there is no such entry, the defaultValue parameter is returned and no exception is raised.

Sample Code

If the User ID is not found in the Dictionary, return "UnknownUser":

Var userID As Integer = 123
Var user As Text
user = d1.Lookup(userID, "UnknownUser")