JSONtoArray() without indexes?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: JSONtoArray() without indexes?

Post by FourthWorld » Tue Mar 22, 2022 4:15 pm

Zax wrote:
Tue Mar 22, 2022 3:18 pm
FourthWorld wrote:
Tue Mar 22, 2022 2:30 pm
Would a simple tab-delimited list suffice?
I started with that, but it soon appears that it was not a good way.
Why?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Zax
Posts: 457
Joined: Mon May 28, 2007 10:12 am
Location: France
Contact:

Re: JSONtoArray() without indexes?

Post by Zax » Tue Mar 22, 2022 5:02 pm

FourthWorld wrote:
Tue Mar 22, 2022 4:15 pm
Zax wrote:
Tue Mar 22, 2022 3:18 pm
FourthWorld wrote:
Tue Mar 22, 2022 2:30 pm
Would a simple tab-delimited list suffice?
I started with that, but it soon appears that it was not a good way.
Why?
Well, I think it's better to have all data result in one formatted line instead of an unknown number of lines, and separated from possible error strings returned by the Python script.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: JSONtoArray() without indexes?

Post by FourthWorld » Tue Mar 22, 2022 5:17 pm

Zax wrote:
Tue Mar 22, 2022 5:02 pm
FourthWorld wrote:
Tue Mar 22, 2022 4:15 pm
Zax wrote:
Tue Mar 22, 2022 3:18 pm

I started with that, but it soon appears that it was not a good way.
Why?
Well, I think it's better to have all data result in one formatted line instead of an unknown number of lines, and separated from possible error strings returned by the Python script.
It's very rare that data coming over the internet is ensured to be limited to a single line. If that's the only concern I'm curious about what makes the Python delivery script brittle enough for that to be an issue.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Zax
Posts: 457
Joined: Mon May 28, 2007 10:12 am
Location: France
Contact:

Re: JSONtoArray() without indexes?

Post by Zax » Wed Mar 23, 2022 8:24 am

No doubt my script is not perfect (I'm new to Python). Also, it can return debugging informations with an unknown number of lines, so it seemed to me that the cleanest way to return valid data was in JSON format.

Zax
Posts: 457
Joined: Mon May 28, 2007 10:12 am
Location: France
Contact:

Re: JSONtoArray() without indexes?

Post by Zax » Wed Mar 23, 2022 12:02 pm

stam wrote:
Mon Mar 21, 2022 8:33 am
FerrusLogic have shared their own parser PhotonJSON as free/opensource.
Just tried PhotoJSON: it works fine and more flexible than JSONToArray :)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: JSONtoArray() without indexes?

Post by FourthWorld » Wed Mar 23, 2022 7:04 pm

Zax wrote:
Wed Mar 23, 2022 12:02 pm
stam wrote:
Mon Mar 21, 2022 8:33 am
FerrusLogic have shared their own parser PhotonJSON as free/opensource.
Just tried PhotoJSON: it works fine and more flexible than JSONToArray :)
Excellent. Good find. Glad you have a solution in hand.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: JSONtoArray() without indexes?

Post by stam » Wed Mar 23, 2022 8:15 pm

Zax wrote:
Wed Mar 23, 2022 12:02 pm
Just tried PhotoJSON: it works fine and more flexible than JSONToArray :)
Glad to hear it’s useful - don’t forget to give them a star on GitHub in way of thanks! I’ll definitely check it out when I have need of JSON…

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”