if and or value required ?? hwy?

 

hi guys  i have this part of script return me error

'!=' - l-value required   

but  why i used it

sinput ENUM_TIMEFRAMES TimeFrameChoice=PERIOD_CURRENT;// Timeframe


void OnInit()
  { 
if((TimeFrameChoice!=PERIOD_W1)|=(TimeFrameChoice!=PERIOD_MN1)|=(TimeFrameChoice!=PERIOD_D1))
     {
      if(Period() != TimeFrameChoice)
        {
         ChartSetSymbolPeriod(0,Symbol(),TimeFrameChoice);  // imposto il timeframe
        }
     }

   else
     {
      int  MessageBox("Non puoi usare il daily e il weekly e il montly ", "Info",0);
     }
  }
 
faustf:

hi guys  i have this part of script return me error

'!=' - l-value required   

but  why i used it


if((TimeFrameChoice!=PERIOD_W1)|=(TimeFrameChoice!=PERIOD_MN1)|=(TimeFrameChoice!=PERIOD_D1))

Those yellow marked characters look to me like pipe character.

That makes expression in the if statement an assignment. Left side of the assignment must be an l-value - something that can have value assigned to.

 
ops  sorry
 
if((TimeFrameChoice!=PERIOD_W1)|=(TimeFrameChoice!=PERIOD_MN1)|=(TimeFrameChoice!=PERIOD_D1))
  1. A |= B equals A = A | B;
              Bitwise Operations - Operations and Expressions - Language Basics - MQL4 Reference
  2. Do you mean if( A || B || C )