I'm probably not understanding something about JFiles:
I try to import two nodes ("P_docidQ" and "ids" both on the top level) into two queues ("P_docidQ" and "SELF.PrQ"), but the second one always is empty ... (I've attached a .json file as a .txt file)
Now If I don't load the first Q, the second will load ... I found out that the during the load of second Q it tries to map to the fields of the first Q ...
(I noticed that in jFiles.clw in the JSONClass._GetFieldName method, that the
names cstring(50),dim(100),static,thread
might be why the second Q keeps looking at the fields of the first Q ...]
I probably need to clear/free something first, but I haven't got a clue what
Any help is most welcome!
TIA
The follwing is the code I use:
! data
lJSON JSONClass
jsonItem &JSONClass
lJP &JSONClass
lJP_PdocidQ &JSONClass
lJP_PrQ &JSONClass
CODE
! ....
lJSON.LoadFile(lFn)
lJP &= lJSON.GetByName('doctype', 1)
IF ~lJP &= NULL
SELF.Doctype = lJP.GetValue()
END
! First Q
FREE(P_DocidQ)
CLEAR(P_DocidQ)
lJP_PdocidQ &= lJSON.GetByName('P_docidQ', 1)
IF ~lJP_PdocidQ &= NULL
lJP_PdocidQ.Load(P_DocidQ)
END
! Second Q
FREE(SELF.PrQ)
CLEAR(SELF.PrQ)
lJP_PrQ &= lJSON.GetByName('ids', 1)
IF ~lJP_PrQ &= NULL
lJP_PrQ.Load(SELF.PrQ)
END
ods('records SELF.PrQ : ' & RECORDS(SELF.PrQ) )