JSONItem.Append

From Real Software Documentation

Jump to: navigation, search
Method
JSONItem.Append ( Value As Variant )

Adds the passed value to the end of a JSONItem array.


Example

The JSON Example project in the Internet folder in the Examples folder that ships with Real Studio builds a JSONItem that is treated like an array. It uses the Append method to build the array. The code is in the Action event handler of the BevelButton in the main window.

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
Personal tools