JSONException

From Xojo Documentation

Class (inherits from RuntimeException)


New in 2011r2

An error occurred when working with a JSONItem.

Properties
ErrorNumber Message Reason fa-lock-32.png
Methods
Stack StackFrames

Sample Code

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

Var 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"

Var 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
Var s As String = person.ToString

TextArea1.Value = s

ListBox1.RemoveAllRows
ShowJSONObject(person)

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

See Also

JSONItem, RuntimeException class.