|
-
Mar 31st, 2021, 01:02 PM
#8
Re: [VB6/VBA] JSON parsing to built-in VBA.Collections
 Originally Posted by shagratt
What will be the right way to detect if a key in the json is an array of results or a simple value?
JSON arrays and JSON objects are represented as VBA.Collections so easiest would be to just check with something like If IsObject(JsonItem(oRoot, "path/to/propery")) Then
Usually the exact keys to the interesting values are known in advance from the Web Service documentation so these get hardcoded in the VB6 source.
For debugging purposes I just use JsonDump like Debug.Print JsonDump(JsonItem(oRoot, "path/to/array"))
cheers,
</wqw>
Last edited by wqweto; Mar 31st, 2021 at 01:48 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|