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

 
Dennis Kirichenko:

Question from a "dummy".

How can I get the value of a key without resorting to the key lookup method?

array elements, as well as for copying the array to the specified element.

The codebase is still being updated. that's why I'm publishing a copy of 1.06 here.

example of new functions

   Print("JASon Example Array access:");
   js["DirAccess"][0]=-1; // direct reference to the element at index 0, which has not existed yet. The element is created immediately
   js["DirAccess"][1]=22;
   string a[] = {"test", "add", "to array"};
   for (int i=0; i<3; ++i) js["ArrayAdd"].Add(a[i]); // adding an element to the array
   CJAson* js_ar=js["ArrayCopy"]; js_ar.Set(js["DirAccess"].m_e); // pay attention to the brackets around 'ArrayCopy'. Он создается новый, и для корректной работы с указателем он должен создасться до обращения к его функции Set
Files:
jason.mqh  30 kb
 

Hello!

Jason.mqh stopped compiling on the latest build 1495.

I suspect it's because of point 5

 

well it's not a problem )

1.07 - fixed compilation bug in build 1495
Files:
JAson.mqh  30 kb
 
o_O:

well it's not a problem )

1.07 - fixed compilation bug in build 1495
Thanks, it works!
 

Great!

Thank you so much.

 
On time! Thank you very much. I also encountered a week ago that it didn't compile, but at first I thought I did something myself. )))
 

Super library.

However, needs a few "cosmetic" adjustments for the current version of MT5, otherwise errors will be thrown.

 

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.

Files:
 
marquez:

However, it needs a few "cosmetic" adjustments for the current version of MT5, otherwise errors will be thrown.

What for?

Version 1.07 compiles without errors.

 
The author has published an update which addresses this issue.