You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi there!
Documentation of JAson library is not full at this site. I wrote documentation with more details and added unit tests: https://github.com/vivazzi/JAson. It may be useful for someone.
Add i created issue that has description of bug of using inner Json (CJAVal object): https://github.com/vivazzi/JAson/issues/1.
CJAVal object is not correctly assigned to another CJAVal object as object:
As workaround, you need use Set() method:
If anyone can help, then many MQL-developers will be grateful as this bug has been around for many years.
Hi there!
Documentation of JAson library is not full at this site. I wrote documentation with more details and added unit tests: https://github.com/vivazzi/JAson. It may be useful for someone.
Add i created issue that has description of bug of using inner Json (CJAVal object): https://github.com/vivazzi/JAson/issues/1.
CJAVal object is not correctly assigned to another CJAVal object as object:
As workaround, you need use Set() method:
If anyone can help, then many MQL-developers will be grateful as this bug has been around for many years.
The problem is with the Copy method.
The key gets overwritten with the subobject's key in your example the "b" gets overwritten with the "nested_data"'s key which is empty.
I used this simple solution, not fully tested:
Thank you, Laszlo Tormasi - your fix works and all tests have passed!
I updated JAson with your fixes: https://github.com/vivazzi/JAson
It works properly on my computer. How do you put the json string into the pJS variable?
@Artem Maltsev Thank you for creating this JSON library. Is it based on some C++ library?
Do you have some performance benchmarks on this? Also, does it internally use 1 byte or 2 byte chars to store the data?
When a value is null, Deserialize() sets the type to jtNULL, but doesn't assign NULL to m_sv, so if ToStr() method is compared to NULL it returns false:
The output is:
2022.03.28 17:50:02.833 test-jsonNULLComparison (GBPUSD,M30) Alert: b is an empty string
The workaround would be comparing the type of value to jtNULL or change the source code at line 220 by adding "m_sv=NULL;":
Can you update Add some function likes
JAval j1; j1.Add(1); j1["a"] = 1; j1["b"] = 2;
can you Add this functions?
see declaration of macro 'DEBUG_PRINT_KEY' JAson.mqh
This warning is coming up on latest mql5 compilation
Any idea how to fix?
Any idea how to fix?
Remove the parenthesis