Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
// Create a JSON array, add elements to it, then remove one
If SRP_JSON(ArrayHandle, "NEW", "ARRAY") then
   SRP_JSON(ArrayHandle, "ADDVALUE", "12345")
   SRP_JSON(ArrayHandle, "ADDVALUE", 67890, "NUMBER")
   SRP_JSON(ArrayHandle, "ADDVALUE", 1, "BOOLEAN")
   Result = SRP_JSON(ArrayHandle, "REMOVE", 2)       ; // Sets element 2 to null
   SRP_JSON(ArrayHandle, "RELEASE")
end

// Create a JSON object, add members to it, then remove one
If SRP_JSON(ObjectHandle, "NEW", "OBJECT") then
   SRP_JSON(ObjectHandle, "SETVALUE", "name", "John Doe")
   SRP_JSON(ObjectHandle, "SETVALUE", "city", "Washington D.C.")
   Result = SRP_JSON(ObjectHandle, "REMOVE", "city") ; // removes "city" member
   SRP_JSON(ObjectHandle, "RELEASE")
end

See Also

REMOVEALL