We are about to switch to a new forum software. Until then we have removed the registration on this forum.
(Sorry found this issue... it works on 2.1b1. reference points to correct for 2.x which i took to include 2.0b3 but that isn't the case.)
I guess i am doing something wrong. I am on processing 2.0b3 OSX 10.8.3. Been using processing for years BUT can't get the JSONObject example to cut and paste and run. Just says cannot find a class or type named "JSONObject". So i did some reading and dropped a json.jar file on the sketch. And then it fails with "The function setInt(String, Int) does not exist".
I'm missing something stupidn like not importing something....it;s been a good year since i last used processing so i probably forgot something simple.
Answers
here...
this works 2.01
you can use cursor left and right
it used to crash in month 2 (one item is null there) but I catch the error now.
Also long headlines are splitted into two lines now
The main point is that JSON is now built in into processing, so you don't need the lib anymore. But the usage seems to be very different from the old usage in the lib. Therefore I had to use JSONarray instead of JSONobject and make minor changes.
I hope this helps.
Greetings, Chrisir
new version which catches the error
Thanks for this. I think it was just confusing regards to libraries needed. I no longer include the library but i had to make the calls like this
processing.data.JSONObject firstobj = theArray.getJSONObject(i);
otherwise it just doesn't work.
great news!
glad to hear...