Sign in to follow this  
Followers 0
CygnusX1

Json help

2 posts in this topic

#1 ·  Posted (edited)

Hello, 

I'm having a really hard time getting this JSON Library to work. I've attached a valid json file.

Seems like something should be written instead of 0.

#include <json.au3>
#include <json_translate.au3>

$sample_json_file = "c:\temp\sample.json"
$var = _JSONDecode($sample_json_file,'JSON_unpack')
ConsoleWrite($var & @CRLF)

I'm not understanding how the decode function works. Or, it's not working. 

Any advice would be helpful.

Thank you.

sample.json

Edited by CygnusX1
Fixed a typo

Cygnus

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@CygnusX1,

employ error checking. add this line right after the line calling _JSONDecode:

ConsoleWrite('@error=' & @error & @CRLF & '@extended=' & @extended & @CRLF)

the result you will see:

@error=7
@extended=0
0

so, somewhere inside the UDF, some function set the @error macro to 7. should be fairly easy to find out where that happened. go into the UDF and add some debugging statements.

Edited by orbs

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0