Create JSON easily from (almost) any arbitrary variable/object/data source... (only WebDev 16)
Sample usage for a direct StringDisplay:
MyObject is MyClass
RSRenderer.RenderObject(MyObject)
Data is Array of 2 int = [5, 3]
RSRenderer.RenderArray(Data)
HExecuteQuery(QRY_MyQuery)
RSRenderer.RenderDataSource(QRY_MyQuery)
HReadSeekFirst(Product, ProductID, 5)
RSRenderer.RenderRecord(Product)
Or if you can obtain the JSON object to serialize it or combine them:
jObj is JSON dynamic = RSRenderer.JsonObject(MyObject)
JsonString is string = jObj.Serialize()
It also works with:
- RSRenderer.JsonArray
- RSRenderer.JsonRecord
- RSRenderer.JsonDataSource
- RSRenderer.JsonAssociative
Works with objects that has any number of variables (or members...), if a class has an object, then the object is also converted into Json, same goes for data sources declared inside an object, arrays, etc...
This classes are NOT fully tested, i'll try to keep this up to date.
Only for WebDev 16, because it needs reflection...