Adds a JSON Entity to a JSON array.
Syntax
Result = SRP_Json(Handle, "Add", NewEntityHandle)
Returns
Returns 1 if successful, 0 if not.
Parameters
Parameter | Description |
---|---|
Handle | Handle to JSON Entity. Required. |
NewEntityHandle | New JSON entity to be added to the JSON array. Required. |
Remarks
The Add service adds the given entity (which must be a valid JSON Entity Handle) to the end of the array. This only works if Handle is a JSON array.
Example
// Create a JSON array (which initializes ArrayHandle) If SRP_Json(ArrayHandle, "New", "Array") then // Create a JSON number If SRP_Json(NumberHandle, "New", "Number", "12345") then // Now add the number to the array SRP_Json(ArrayHandle, "Add", NumberHandle) // Remember to release entities you've created SRP_Json(NumberHandle, "Release") end // Remember to release entities you've created SRP_Json(ArrayHandle, "Release") end