From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

JSONItem.Lookup(Name As String, DefaultValue As Variant) As Variant

New in 2011r3

Supported for all project types and targets.

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


If Name is found, it returns the corresponding value. If Name is not found, it returns the passed DefaultValue.


Var myChild As New JSONItem

myChild.Value("Name") = "Fred"
myChild.value("Age") = 12
myChild.value("Married") = False

Var v As Variant
v = myChild.Lookup("Age", "Data not found")
MessageBox(v) // displays the value for Age