Forum Post: RE: merging json objects

  • Thread starter Thread starter jmls
  • Start date Start date
Status
Not open for further replies.
J

jmls

Guest
actually, there's a nasty little bug hiding in here getType() returns jsonDataType:NUMBER for both integer and decimal so, you don't know to use getInteger() or getDecimal() .. which is a problem .. let's say that the property in source is an integer. this means that oTarget:add(lv_name[lv_i],oSource:Decimal(lv_name[lv_i])) would add a decimal property to the target but if I used oTarget:add(lv_name[lv_i],oSource:GetInteger(lv_name[lv_i])) on a decimal property on the source , the add fails because I tried to get a integer .. so, the question now is not knowing the structure of the json file, and having to rely on GetType() to determine the type of the property. how can I add a decimal field if the source property is decimal, and a n integer property if the source property is integer ??

Continue reading...
 
Status
Not open for further replies.
Back
Top