You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Adds a JSON Entity to a JSON array.

Syntax

Result = SRP_JSON(Handle, "ADD", NewEntityHandle)

Returns

Returns 1 if successful, 0 if not.

Parameters

ParameterDescription
HandleHandle to JSON Entity. Required.
NewEntityHandleNew 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

See Also

ADDVALUE

  • No labels