Hi Everyone,
I'm interested in finding out if LiveCode has a JSON parser available.
What I would like to do is to consume a JSON feed and dump the array data into a tableview/datagrid. Is this currently possible with LiveCode?
Thank you.
What are the available JSON parsers for LiveCode?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 20
- Joined: Fri Nov 09, 2012 11:02 pm
Re: What are the available JSON parsers for LiveCode?
Hi,
At http://revonline2.runrev.com/stack/82/LibJson-1-0b you'll find Mark Smith's "LibJson 1.0b", which is a stack that converts back and forth between json and livecode arrays. The array elements can be copied onto stacks or fields (or tableview/datagrid I imagine).
The stack has some nice samples, and worked well with the 50 element json file I had. (The json data I was using had some errors that the validator at http://jsonlint.com helped me find and fix: be sure not to have returns and quotes inside your json data elements! Until your json is clean, no parser can deal with it.
I haven't yet worked with putting data into datagrid so I can't help with that part, which I suspect is very possible with livecode.
best wishes
Mike
At http://revonline2.runrev.com/stack/82/LibJson-1-0b you'll find Mark Smith's "LibJson 1.0b", which is a stack that converts back and forth between json and livecode arrays. The array elements can be copied onto stacks or fields (or tableview/datagrid I imagine).
The stack has some nice samples, and worked well with the 50 element json file I had. (The json data I was using had some errors that the validator at http://jsonlint.com helped me find and fix: be sure not to have returns and quotes inside your json data elements! Until your json is clean, no parser can deal with it.
I haven't yet worked with putting data into datagrid so I can't help with that part, which I suspect is very possible with livecode.
best wishes
Mike
-
- Posts: 20
- Joined: Fri Nov 09, 2012 11:02 pm
Re: What are the available JSON parsers for LiveCode?
Thanks Mike!
That was very helpful. I'll dig into it a bit more. I need to be able to fill the data grid with JSON data. Since it's all indexed arrays, I know it's possible. I checked out the data grid object. So far, some really great documentation from RunRev. I'm going to see what I can build.
That was very helpful. I'll dig into it a bit more. I need to be able to fill the data grid with JSON data. Since it's all indexed arrays, I know it's possible. I checked out the data grid object. So far, some really great documentation from RunRev. I'm going to see what I can build.