<div dir="ltr"><div dir="ltr">Two valid JSON files will not parse properly with a call to <br></div><div dir="ltr"><br></div><div dir="ltr">JSON.Decode(<json file contents>, True)<br><br>Consider this is valid JSON:<br>[<br> {<br> "name" : "Value",<br> "another" : "Value"<br> }<br>]<br><br>The above will decode as a Variant[] and not a JSONCollection.<br><br>Consider this other valid JSON:<br><br>{ <br> "name" : "value",<br> "another" : {<br> "nestedname" : "value"<br> }<br>}<br><br>These will return as JSONCollections.<br><br>This
is somewhat as expected, however there is no way to gracefully detect
what type of object has been decoded. Using Try blocks to determine by
trial and error which of the above forms of a JSON are present cannot be
good programming form. The TypeOf(<json file contents>) function
gives a gb.object type of object for both. This is very problematic when
parsing large files. What is the proper work around or how is this been
properly used in these cases (what am I missing about this?)</div></div>