Read Json Array

balta

New Member
Hello,

Any have code to read a Json Array from a file and do the loop?

Code:
DEFINE VARIABLE JsonParser_arr   AS ObjectModelParser NO-UNDO.
DEFINE VARIABLE ResultObject_arr AS JsonArray        NO-UNDO.

JsonParser_arr= NEW ObjectModelParser().
ResultObject_arr = CAST(JsonParser_arr:ParseFile("c:\temp\test_array.json"), JsonArray).
My code.. What i can to do the loop of values?

Thanks,
Baltazar
 

Stefan

Active Member
Code:
DEFINE VARIABLE irows      AS INTEGER     NO-UNDO.
DEFINE VARIABLE icrow      AS INTEGER     NO-UNDO.
DEFINE VARIABLE oJsonRow   AS JsonObject     NO-UNDO.

irows = ResultObject_arr:Length.

DO icrow = 1 TO irows:

   oJsonRow = ResultObject_arr:GetJsonObject( icrow ).

END.
 

balta

New Member
Thanks a Lot! :)

Doing this..

Code:
length(ResultObject_arr):
 
Top