Versions Compared

Key

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

...

Code Block
// Create a JSON array, add elements to it, and get the count
If SRP_JSON(ArrayHandle, "NEW", "ARRAY") then
   SRP_JSON(ArrayHandle, "ADDVALUE", "12345")
   SRP_JSON(ArrayHandle, "ADDVALUE", 67890, "NUMBER")
   SRP_JSON(ArrayHandle, "ADDVALUE", 1, "BOOLEAN")
   Count = SRP_JSON(ArrayHandle, "GETCOUNT")     ; // Returns 3
   SRP_JSON(ArrayHandle, "RELEASE")
end

// Create a JSON object, add members to it, and get the count
If SRP_JSON(ObjectHandle, "NEW", "OBJECT") then
   SRP_JSON(ObjectHandle, "SETVALUE", "name", "John Doe")
   SRP_JSON(ObjectHandle, "SETVALUE", "city", "Washington D.C.")
   Count = SRP_JSON(ObjectHandle, "GETCOUNT")    ; // Returns 2
   SRP_JSON(ObjectHandle, "RELEASE")
end

See Also

GETMEMBERS