Versions Compared

Key

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

...

Code Block
// Create a simple string entity
If SRP_Json(StringHandle, "New", "STRINGString", "Hello, World!") then

   // Create a JSON array, set elements in any order
   If SRP_Json(ArrayHandle, "New", "ARRAYArray") then
       SRP_Json(ArrayHandle, "Set", 1, StringHandle)
       SRP_Json(ArrayHandle, "Set", 10, StringHandle)
       SRP_Json(ArrayHandle, "Set", 5, StringHandle)
       SRP_Json(ArrayHandle, "Release")
   end
   
   // Create a JSON object, add members to it
   If SRP_Json(ObjectHandle, "New", "OBJECTObject") then
       SRP_Json(ObjectHandle, "Set", "first-member", StringHandle)
       SRP_Json(ObjectHandle, "Set", "second-member", StringHandle)
       SRP_Json(ObjectHandle, "Release")
   end
   
   // Remember to release handles we created
   SRP_Json(StringHandle, "Release")
   
end

...