This is a valid json
:
[{"id":1, "name":"foo"}, {"id":2, "name":"bar"}]
How do I create a TSuperObject
from this string
?
This is a valid json
:
[{"id":1, "name":"foo"}, {"id":2, "name":"bar"}]
How do I create a TSuperObject
from this string
?
If you open the readme.html
inside a browser you will see at the very first beginning of that document:
var
obj: ISuperObject;
begin
obj := SO('{"foo": true}');
obj := TSuperObject.ParseString('{"foo": true}');
obj := TSuperObject.ParseStream(stream);
obj := TSuperObject.ParseFile(FileName);
end;
There is a bug for Delphi 6.
When the
SO()
function tries to convert the value of the string, it raisesEIntOverflow
.The bug is due to this function:
This is the bug in the google's issue tracker
The workaround proposed by the bug's reporter is changing the function to this: