JSONArray (open)
JSON array wrapper, contains a list of values
Syntax
// Core function, no LOADLIB necessary
OBJECTTYPE JSONArray
Constructor
- MACRO NEW(VARIANT ARRAY initval)
Constructs a new JSON array, converts the records and arrays in the value to JSONObject and JSONArray
Properties
- PROPERTY length
Length of this array
Functions
- MACRO AppendArray(VARIANT value)
Appends the contents of an array
- OBJECT FUNCTION DeepClone()
Returns a deep clone of this object
- VARIANT FUNCTION GetElt(INTEGER idx)
Get the value from the specified index
- VARIANT ARRAY FUNCTION GetRawElements()
Returns the raw values in the array
- VARIANT ARRAY FUNCTION GetValue()
Returns the value in this array as HareScript value (converting all contained JSONObject and JSONArray objects to their HareScript value too)
- MACRO Push(VARIANT value)
Adds a value to the back of the array
- MACRO SetElt(INTEGER idx, VARIANT value)
Sets the value at the specified index
- MACRO SetValue(VARIANT ARRAY val)
Overwrites the contents of this array
- OBJECT FUNCTION Splice(INTEGER start, INTEGER deletecount, VARIANT ARRAY vals)
Removes values from the array, and adds some new ones
- MACRO Unshift(VARIANT value)
Adds a value to the start of the array