What are the available JSON parsers for LiveCode?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
codemonster
Posts: 20
Joined: Fri Nov 09, 2012 11:02 pm

What are the available JSON parsers for LiveCode?

Post by codemonster » Sat Nov 10, 2012 4:37 am

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.

mroam
Posts: 11
Joined: Tue Nov 27, 2007 8:11 pm
Contact:

Re: What are the available JSON parsers for LiveCode?

Post by mroam » Sat Nov 10, 2012 8:47 am

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

codemonster
Posts: 20
Joined: Fri Nov 09, 2012 11:02 pm

Re: What are the available JSON parsers for LiveCode?

Post by codemonster » Sat Nov 10, 2012 4:36 pm

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.

Post Reply