JArray
JArray class
Signature
Dim myJArray As JArray
Summary
A JSON array with 0-based positions.
Parameters
None
Remarks
Not created directly; returned by other members of the library.
| Member | Kind | Summary |
|---|---|---|
| `Add` | Method | Appends a value and returns its node. |
| `AddElement` | Method | Appends a new, empty object. |
| `AddArray` | Method | Appends a new, empty array. |
| `Insert` | Method | Inserts a value at a 0-based position. |
| `RemoveAt` | Method | Removes the element at a 0-based position. |
| `Clear` | Method | Removes all elements. |
Code example
None
Inheritance
JArray inherits every member of `JNode`; inherited members are described on the base class's page.
Add method
Signature
Function Add(ByVal Value As Variant) As JNode
Summary
Appends a value and returns its node.
Parameters
| Name | Type | Optional | Default | Description |
|---|---|---|---|---|
Value | Variant | No | – | The value (the types of `JNode.Value`), or a node to insert (rules as in `JElement.SetValue`). |
Return value: `JNode` – The new node.
Remarks
A one-dimensional VBA array is added as a JSON array.
Code example
None
Inheritance
Declared by JArray.
AddElement method
Signature
Function AddElement() As JElement
Summary
Appends a new, empty object.
Parameters
None
Return value: `JElement` – The new `JElement`.
Remarks
None
Code example
None
Inheritance
Declared by JArray.
AddArray method
Signature
Function AddArray() As JArray
Summary
Appends a new, empty array.
Parameters
Remarks
None
Code example
None
Inheritance
Declared by JArray.
Insert method
Signature
Function Insert(ByVal Index As Long, ByVal Value As Variant) As JNode
Summary
Inserts a value at a 0-based position.
Parameters
| Name | Type | Optional | Default | Description |
|---|---|---|---|---|
Index | Long | No | – | The position; Count appends. |
Value | Variant | No | – | The value, or a node to insert. |
Return value: `JNode` – The new node.
Remarks
None
Code example
None
Inheritance
Declared by JArray.
RemoveAt method
Signature
Sub RemoveAt(ByVal Index As Long)
Summary
Removes the element at a 0-based position.
Parameters
| Name | Type | Optional | Default | Description |
|---|---|---|---|---|
Index | Long | No | – | The position; negative positions are not allowed. |
Remarks
None
Code example
None
Inheritance
Declared by JArray.
Clear method
Signature
Sub Clear()
Summary
Removes all elements.
Parameters
None
Remarks
None
Code example
None
Inheritance
Declared by JArray.