JSONException

From Xojo Documentation
Jump to: navigation, search

Class (inherits from RuntimeException)

An error occurred when working with a JSONItem.

Example

The following Exception block catches any JSONItem errors in the method.

Dim person As New JSONItem
// This object is manipulated like a dictionary
person.Value("Name") = "John Doe"
person.Value("Age") = 32
person.Value("Married") = True
person.Value("Spouse") = "Jane Doe"

Dim kids As New JSONItem
// This object is manipulated like an array
kids.Append("John Jr")
kids.Append("Jamie")
kids.Append("Jack")
kids.Append("Josie")
kids.Insert(0, "Jen")
kids.Remove(2)
person.Value("Kids") = kids

person.Compact = True
Dim s As String = person.ToString

TextArea1.Text = s

ListBox1.DeleteAllRows
ShowJSONObject(person)

Exception err As JSONException
MsgBox("A JSONException has occurred.")

See Also

JSONItem, RuntimeException class.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About