meaning of wierd syntax

 

Hello, 

I was dissecting an MQL4 script and saw something I don't understand. I found nothing on the web, nor in the documentation concerning the symbols and operators... so I'm hoping someone's going to help me.

The line is:      "variable1=variable2==?variable3:Function1(parameters1);"          (the Function1 gives back a double type of value)

What the heck is "==?" and what is ":" symbol?  

Thank you!

 
It calls 'Ternary Operator ?:'. Regarding MQL4/5 you can find information here: https://www.mql5.com/en/docs/basis/operators/ternary
Documentation on MQL5: Language Basics / Operators / Ternary Operator ?:
Documentation on MQL5: Language Basics / Operators / Ternary Operator ?:
  • www.mql5.com
, the third operand - "expression3" is performed. The second and third operands, i.e. "expression2" and "expression3" should return values of one type and should not be of void type. The result of the conditional operator execution is the result of expression2 or result of the expression3, depending on the result of expression1. Operator Use...
 

Sergey Eremin:
It calls 'Ternary Operator ?:'. Regarding MQL4/5 you can find information here: https://www.mql5.com/en/docs/basis/operators/ternary

OMG, I finnaly understand! Thank you a lot and have a good day! :D

 
bogdy101:

...have a good day! :D

Thanks, you too!