Libraries: JSON Parser - page 4

To add comments, please log in or register
winloosewin
62
winloosewin  

Since the newest MT4 build (Version 4 Build 1212, 10 Sep 2019) the json.mqh does not compile any more.

The compiler complains about a protected class member not being accessible.

I fixed it here.

Files:
json.mqh 49 kb
franconalinares
7
franconalinares  
winloosewin:

Since the newest MT4 build (Version 4 Build 1212, 10 Sep 2019) the json.mqh does not compile any more.

The compiler complains about a protected class member not being accessible.

I fixed it here.

Im seeing that you fix error "protected class member not being accessible" but show another error : "   'isValid' - function not defined json.mqh 649 46 "


Know how to fix it?

winloosewin
62
winloosewin  
franconalinares:
Im seeing that you fix error "protected class member not being accessible" but show another error : "   'isValid' - function not defined json.mqh 649 46 "


Know how to fix it?

It seems that you use the original hash.mqh file from ydrol.

The error should be fixed if you use mine in the attachment.

Some time ago I added a function isValid() in hash.mqh that does exactly the same as the original hasNext() from ydrol.

In my opinion the name isValid() describes the behaviour of the function better.

Files:
hash.mqh 25 kb
franconalinares
7
franconalinares  

I got a new problem.

When i run the EA, got a problem on 516 line of json.mqh you provided, always fail getValue(key) function

When compile the json.mqh and hash.mqh got many errores 581 in hash and 1739 on json.mqh

Someone got those problems.

franconalinares
7
franconalinares  

Problem solved, was my mistake.


Thanks,

trader-aether
5
trader-aether  

There is a subtle bug in the parsing of negative integers, where the preceding '-' is parsed as a digit, resulting in wrong values. This might already have been fixed in a newer version, but the link to the newest version in the library description (http://www.lordy.co.nf/mql4/) is broken.

A quick way to fix this is to change json.mqh line 670 from

l = l * 10 + ( _in[i] - '0' );

to

if (_in[i] != '-' && _in[i] != "+") {
        l = l * 10 + ( _in[i] - '0' );
}

I apologize if this has already been discussed.

zboo
19
zboo  

Thank you winloosewin.

you are my hero.

To add comments, please log in or register