Does anyone know if the Precedence rules for logical operators(combining && and || in "if" statements) have been normalized to standard C rules?.
There is a mention in the MQL4 manual that states that they deviate, and have found this to be so in some of my code. The combination of && and || in a complex "if" statement can have unpredictable results(ie. It is my observation that MQ4 would evaluate ALL conditions before taking the path. If you have boolean functions which write/update a file, it will perform the I/O operation even though a preceeding condition was not met.)
Any knowledge of this info will be greatly appreciated!
Thanks in advance ,
gjrexach
Does anyone know if the Precedence rules for logical operators(combining && and || in "if" statements) have been normalized to standard C rules?.
There is a mention in the MQL4 manual that states that they deviate, and have found this to be so in some of my code. The combination of && and || in a complex "if" statement can have unpredictable results(ie. It is my observation that MQ4 would evaluate ALL conditions before taking the path. If you have boolean functions which write/update a file, it will perform the I/O operation even though a preceeding condition was not met.)
Any knowledge of this info will be greatly appreciated!
Thanks in advance ,
gjrexach
Can you give a simple example that does not work for you ? Rules for MQL5 are the same as for C++.
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Does anyone know if the Precedence rules for logical operators(combining && and || in "if" statements) have been normalized to standard C rules?.
There is a mention in the MQL4 manual that states that they deviate, and have found this to be so in some of my code. The combination of && and || in a complex "if" statement can have unpredictable results(ie. It is my observation that MQ4 would evaluate ALL conditions before taking the path. If you have boolean functions which write/update a file, it will perform the I/O operation even though a preceeding condition was not met.)
Any knowledge of this info will be greatly appreciated!
Thanks in advance ,
gjrexach