switch, case etc.
Neither this "case 1<5:" (it might always be 1)
nor this "if(0<x<5)" is working in MQL4/5 - just place the cursor above switch and press F1 and start reading..
would like to know if with switch function i can use a range instead of a precise value
The documentation page for switch is helpful.
https://www.mql5.com/en/docs/basis/operators/switch
- Jack
- www.mql5.com
The documentation page for switch is helpful.
https://www.mql5.com/en/docs/basis/operators/switch
- Jack
i checked this page before writing here, but it doesnt show the example of a range.
i know how to do with if, but i wanted to know if i can do also with switch/case
case 1: case 2: case 3: case 4: case 5: res=i;break;
if( 3 < 2 < 1 ) if( false < 1 ) if( 0 < 1 ) if( true ) | if( 3 > 2 > 1 ) if( true > 1 ) if( 1 > 1 ) if( false ) |
Hi
would like to know if with switch function i can use a range instead of a precise value
like this
ora i have to use if