The library works in MQL4 and MQL5
Gratitude is accepted in the form of examples of your practical work with web resources from MQL. ;)
Works in MT4. In MT5 the error Stack overflow is displayed. There is no information about the location of the overflow. And the debugger simply crashes.
The error appears in an elementary example:
#include <jason.mqh> void OnStart() { CJAVal json; json["item1"] = "value1"; json["item2"] = "value2"; }
As it turned out, the script crashes on line 90, increasing the size of 'm_e' from 1 to 2x:
ArrayResize(m_e,c+1);
P.S. MT5 build 1210
Works in MT4. In MT5 the error Stack overflow is displayed. There is no information about the location of the overflow. And the debugger simply crashes.
The error appears in an elementary example:
As it turned out, the script crashes on line 90, increasing the size of 'm_e' from 1 to 2x:
P.S. MT5 build 1210
Thanks for the lib, but there are some problems.
I can't figure out how I can stick an array using the library?
For example, there are
string a[] = {"1", "2", "3"}; int b[] = {1, 2, 3}; double c[] = {1.1, 2.9, 3.03};
The problems arise at the level of declaring a variable of CJAVal type. Using CJAVal primer(jtARRAY, a); does not help.
The array example you showed in the example doesn't work for me - what if I have 10 values in the array? I have to create new 10 variables of CJAVal type????
Could you please supplement or expand the example file ?????
p.s. I work with json format for the first time. I studied your example file programme.
Wow, that's hard work! And for what? To extract a couple of variables from a small line.
Why is the code formatted like that? So that nobody even tries to look into it? It's a codebase, after all.
Wow, that's hard work! And for what? To extract a couple of variables from a small line.
Why is the code formatted like that? So that nobody even tries to look into it? It's a codebase, after all.
I am interested in the idea of quickly writing any data to a file and quickly extracting it. It's a pity that the liba doesn't format readability for the human eye :( I'm inclined to the fact that I'll probably write such a program for my own tasks.
The code has been simplified as much as possible - minimisation!
I am interested in the idea of quickly writing any data to a file and quickly extracting it. It's a pity that the lib doesn't format readability for the human eye :( I'm inclined to the fact that I'll probably write such a program for my own tasks.
The code has been simplified as much as possible - minimisation!
It is not good for such a task, it is not like serialisation in PHP or C#.
There is one spoonful of tartness here:
virtual CJAVal *FindKey(string akey) { for(int i=0; i<ArraySize(m_e); i++) if(m_e[i].m_key==akey) return GetPointer(m_e[i]); return NULL; }The key is searched by simple brute force. You can't work quickly with large data.
It's not good for this task, it's not like serialisation in PHP or C#.
There is one spoonful of tar here:
The key is found by a simple brute force search. You will not be able to work quickly with large data.There's a limited number of hash elements, if I'm not mistaken.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
JSON Serialization and Deserialization (native MQL):
Serialization and deserialization of JSON protocol. The code is ported from a high-speed С++ library.
Practical example: authorization on a website and parsing the response
Author: o_O