convert structured list() to json string

Just starting out? Need help? Post your questions and find answers here.
menschmarkus
Posts: 54
Joined: Thu Apr 10, 2014 3:35 pm

convert structured list() to json string

Post by menschmarkus »

Hi,

converting a JSON string to a structure is easy. You just need to use ExtractJSON....
But how is about converting a structured list() into a JSON String? I did not find a similar command like ExtractJSON for converting JSON to structure.
Do I really need to pass throug the complete list and build the JSON String manually?
as soon you do it right, it works !
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: convert structured list() to json string

Post by Peter »

InsertJSONStructure() ;)
menschmarkus
Posts: 54
Joined: Thu Apr 10, 2014 3:35 pm

Re: convert structured list() to json string

Post by menschmarkus »

I am a fool :shock:
reading educates :oops:
as soon you do it right, it works !
User avatar
Kurzer
Posts: 96
Joined: Mon May 26, 2014 9:33 am

Re: convert structured list() to json string

Post by Kurzer »

Menschmarkus,

keep in mind that the order of the structure members can always be random.

From my own experience I can say that the order of structure members in SpiderBasic and Purebasic is not always different, but both development environments produce a different version of a JSON string from the same structure.

I have experienced this in my current project and had to build the string myself (because of cross compatibility).

Markus
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
Post Reply