Adds an array of values to a JSON array. New in 2.1.1


Result = SRP_Json(Handle, "AddValueArray", Array, Delim)


Returns 1 if successful, 0 if not.


HandleHandle to JSON Entity. Required.
ArrayArray of values to be added to the JSON array. Required.
DelimThe array's delimiter. Optional.


The AddValueArray service adds the given array of values as a single array node to the end of the array. This only works if Handle is a JSON array. Normally, to add an array to the end of another array, you'd have to call AddValue repeatedly:

ValueArray = "1,2,3,4"
If SRP_Json(SubArrayHandle, "New", "Array") then
	For each Value in ValueArray using ","
		SRP_Json(SubArrayHandle, "AddValue", Value)
	Next Value
    SRP_Json(MainArrayHandle, "Add", SubArrayHandle)
    SRP_Json(SubArrayHandle, "Release")

This service does that work for you, simplifying the above code to this:

SRP_Json(MainArrayHandle, "AddValueArray", "1,2,3,4", ",")

The Delim parameter indicates the delimiter used to separate values in Array, which defaults to @FM if omitted.


// Create an array, add a couple values, then add a sub-array
If SRP_Json(ArrayHandle, "New", "Array") then
   SRP_Json(ArrayHandle, "AddValue", "Hello, World!", "String")
   SRP_Json(ArrayHandle, "AddValue", 67890, "Number")
   SRP_Json(ArrayHandle, "AddValueArray", "1~2~3~4~5", "~")

   SRP_Json(ArrayHandle, "Release")

See Also


  • No labels