JSON Object - setFloatArray() doesnt exist
Closed this issue · 1 comments
Issue description
I'm new to Processing and have tried to create a JSON DB comprising an object with key/'float array' pair. But it doesn't seem to be possible to associate a 'float array' or 'FloatList' with a single key using any of the current Methods in Processing at the moment. It only seems to be possible to associate a single float variable, not a an array of float variables to a sing key. I checked to see if its a valid JSON format to associate an array of floats to a single key in a JSON object, using the tool on https://jsonformatter.curiousconcept.com/ and it returned as valid JSON Standard RFC 4627. So I guess it would be fine to create a Processing method to handle this, unfortunately its far beyond my level at the moment so if anyone is up for it I think it would be a good addition.
Example implementation:
JSONObject myObject= new JSONObject();
myObject.setFloatList("key",myFloatList);
URL(s) of affected page(s)
Proposed fix
First, I'm sorry it took so long to reply. Second, this isn't the right place to make a feature request for how JSON works with Processing. That should happen at the /processing/processing/ repo, where the source code is maintained. I don't work with JSON, so I can't advise how you might do what you're trying to do with the current API. A discussion at the Forum might yield some advice or support for the idea: https://discourse.processing.org