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 stringify it fast
If SRP_JSON(ArrayHandle, "NEW", "ARRAY") then
   SRP_JSON(ArrayHandle, "ADDVALUE", "12345")
   SRP_JSON(ArrayHandle, "ADDVALUE", 67890, "NUMBER")
   SRP_JSON(ArrayHandle, "ADDVALUE", 1, "BOOLEAN")
   JSON = SRP_JSON(ArrayHandle, "STRINGIFY", "FAST")
   SRP_JSON(ArrayHandle, "RELEASE")
end

// Create a JSON object, add members to it, and stringify it pretty
If SRP_JSON(ObjectHandle, "NEW", "OBJECT") then
   SRP_JSON(ObjectHandle, "SETVALUE", "name", "John Doe")
   SRP_JSON(ObjectHandle, "SETVALUE", "city", "Washington D.C.")
   JSON = SRP_JSON(ObjectHandle, "STRINGIFY", "STYLED")
   SRP_JSON(ObjectHandle, "RELEASE")
end

See Also

PARSE