Little John wrote:Are you looking for something like
this?
The procedure TraverseJSON() should work for all kinds of dynamic JSON data.
Hi Little John,
yes, thank you! I've managed to adapt your code for some testing purpose. But on a path of Lunasole's statement...
Lunasole wrote:Hah, I understand how you feel trying to do something with this.
I really felt intellectually undercapacitated for not being able to quickly fully grasp logic and motives behind JSON formating...
The stupid is JSON format itself, not a question. I definitely just hate this web-trash, also last time had to work with it a lot too. Even XML is much better.
Well, frankly, so far I've had much more luck with JSON than XML, owing to XML validation, normalization and some other processes that I have to study harder. I am actually adding some REST API code to my current software for communication with web shops, so that's the reason for exploring XML/JSON in the first place...
For your example you should do something like this
/snip
Generally you need first to GetJSONMember (moving to element you need and referencing it by key), then you using returned value to receive specific data by one of functions for this
I've been using freek's code from here:
http://forum.purebasic.com/english/view ... 12&t=62502 and that ExtractJSONStructure().
Is there any reason to believe that approach is suboptimal for any reason whatsoever? I'm basically adding elements to list of structures.