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,"Jonah")
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