How to fill a structure from very big json?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Caronte3D
Addict
Addict
Posts: 1029
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

How to fill a structure from very big json?

Post by Caronte3D »

I need to use a very big json (esp_verbos.json from here: https://github.com/asosab/esp_verbos)
I used a tool from Freak user (thanks): https://www.purebasic.fr/english/viewtopic.php?t=62502 to generate the structure.

Code: Select all

Structure Json_2
  tu$
  Uds$
  Ud$
  yo$
  vosotros$
  nosotros$
EndStructure

Structure Json_1
  negativo.Json_2
  afirmativo.Json_2
EndStructure

Structure Json_3
  Map preterito$()
  Map presente$()
  Map futuro$()
  Map imperfecto$()
  Map condicional$()
EndStructure

Structure Json_4
  Map preterito$()
  Map presente$()
  Map futuro$()
  Map pasado$()
  Map condicional$()
EndStructure

Structure Json_5
  Map presente$()
  Map futuro$()
  Map pasado$()
EndStructure

Structure Json_6
  Map presente$()
  Map imperfecto2$()
  Map futuro$()
  Map imperfecto$()
EndStructure

Structure Json
  verbo$
  imperativo.Json_1
  progresivo.Json_3
  perfecto.Json_4
  perfecto_subjuntivo.Json_5
  subjuntivo.Json_6
  indicativo.Json_3
EndStructure

I tryed the command ExtractJSONStructure but with no success, I think becaudse I never used json library and don't understand it enough :|
What is the way to populate an array of this type of structure so I can access each element the fastest way possible?
User avatar
Kiffi
Addict
Addict
Posts: 1353
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: How to fill a structure from very big json?

Post by Kiffi »

Code: Select all

NewList J.Json()

LoadJSON(0, "[Path]\esp_verbos.json")
ExtractJSONList(JSONValue(0), J())

ForEach J()
  Debug J()\verbo$
Next
Hygge
User avatar
Caronte3D
Addict
Addict
Posts: 1029
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: How to fill a structure from very big json?

Post by Caronte3D »

That easy? :shock:
Thank you very much Kiffi :D
Post Reply