Libraries: JSON Serialization and Deserialization (native MQL) - page 5

 
Amy Liu:

After update MetaEditor to Version: 5.00 build 1498, compiling the code generates error bellow:

cannot implicitly convert type 'string' to 'bool'.

Line 53: void operator=(string a) { m_type=a?jtSTR:jtNULL; m_sv=a; m_iv=StringToInteger(m_sv); m_dv=StringToDouble(m_sv); m_bv=a!=NULL; }

It seems that  m_type=a?jtSTR:jtNULL is not supported in this version.

Fixes:

Line  53: void operator=(string a) { m_type=a!=NULL?jtSTR:jtNULL; m_sv=a; m_iv=StringToInteger(m_sv); m_dv=StringToDouble(m_sv); m_bv=a!=NULL; }

Line 80: case jtSTR: m_sv=Unescape(a); m_type=m_sv!=NULL?jtSTR:jtNULL; m_iv=StringToInteger(m_sv); m_dv=StringToDouble(m_sv); m_bv=m_sv!=NULL; break;

 
Resophonic:
The author has published an update which addresses this issue.
I have fixed this issue. But it will be good to see what the author did. How can I find it? Thanks.
 
Amy Liu:
I have fixed this issue. But it will be good to see what the author did. How can I find it? Thanks.
You can download it here: https://www.mql5.com/en/code/13663
 
Resophonic:
You can download it here: https://www.mql5.com/en/code/13663
Thank you very much!
 
o_O:

What for?

Version 1.07 compiled without errors.

Fact.

Before I posted my comment, I had a look at the source under "view" and included it. There seems to have been something old. Something must have overlapped, or old code was output cached here.

When did you update? It might always be interesting to know.


 
marquez:
When did you update ?

I added everything in the ru section (which I know better than German)
but the moderator does not translate this description

https://www.mql5.com/ru/code/13663

 
Artem, hello! After the release of version 1.07 the change that was made in version 1.05 (((( stopped working.
 
fixed it.
Files:
jason.mqh  31 kb
 
o_O:
fixed it.
Oh, great! Everything is working! Thank you for your work and for the efficiency!!! I understand the version number was not changed.
 

v1.08

Fixed parsing of array of arrays (e.g. { "a":[[1],[2]] } )

Files:
JAson.mqh  31 kb