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

GetElementsGetMembers