JSON support?
Something like the Python API?
https://www.w3schools.com/python/python_json.asp
Yes JSON is supported.
Here's an example: https://github.com/smallbasic/smallbasic.github.io/blob/58e9d03ec5260ff9c29a6067f50988e72c3cabb1/samples/node/1266.bas
Yes JSON is supported.
Here's an example: https://github.com/smallbasic/smallbasic.github.io/blob/58e9d03ec5260ff9c29a6067f50988e72c3cabb1/samples/node/1266.bas
This is about reading JSON. What about writting JSON? I want to write formatted JSON like json.dump() of Python.
@chrisws
No answers means not available man. JSON is always related to Object. This language has no Objects (nor structures), so the best it could map JSON is to an Array (Array of this language is in fact a List). There will be no intuitive way to construct an "JSON Array".
Sorry for the late reply. Actually you can write JSON by passing a map variable to STR(), like this:
foo={}
foo.dog = "jessie"
foo.hello = "you"
print str(foo)
prints:
{"dog":"jessie","hello":"you"}
Also: another example worth examining:
https://github.com/smallbasic/SmallBASIC/blob/master/samples/distro-examples/games/2048.bas
It would be possible to write an extension module with more extensive JSON support.