Download MetaTrader 5

The operator "or"

To add comments, please log in or register
Enable MQL5 Storage to store your source codes. It is free!
ForexTrader17 2015.06.12 01:42 

While using "or" for say 5 statements, if the first or second return true will MQL4 still check all 5?

Thank you. 

honest_knave 2015.06.12 05:27  


From MetaTrader 4 Trading Terminal build 600 with Updated MQL4 Language and Market of Applications Released:

  • Shortened conditions check is now used in logical operations, unlike the old MQL4 version where all expressions have been calculated and the check has been performed afterwards. Suppose there is a check of two conditions with the use of logical AND
      if(condition1 && condition2)
         // some block of operations
    If condition1 expression is false, calculation of condition2 expression is not performed, as false && true result is still equal to false.
To add comments, please log in or register