Error - check operator precedence for possible error; use parentheses to clarify precedence

Back to topics list To post a new topic, please log in or register
avatar
1
dhunay 2016.04.15 05:24
 

 Hey guys im getting the error message -

 check operator precedence for possible error; use parentheses to clarify precedence

 

FOR THE LINE

 

 if (!All_Trendline_Alert && ObjectName(li_28) != High_TL_Name || ObjectName(li_28) != Low_TL_Name) continue;

 

can somebody tell me what im doing wrong as im new to coding.

 

Thanks In advance 

avatar
1109
Ovo 2016.04.15 06:24 #
 

The operator precedence in logical expressions has changed recently. Though this expression compiles, the compiler detected your expression is probably affected by the recent change. So include some parentheses to specify the precedence clearly.

And an advice: using variable names like "li_28" is sign of piracy (stolen code), avoid them.

avatar
12995
WHRoeder 2016.04.15 15:32 #
 
  1. This can be interpreted two different ways. Always use parentheses when mixing ands and ors.
    if (!All_Trendline_Alert && ObjectName(li_28) != High_TL_Name || ObjectName(li_28) != Low_TL_Name) continue;
    
    if((!All_Trendline_Alert && ObjectName(li_28) != High_TL_Name)|| ObjectName(li_28) != Low_TL_Name) continue;
    
    if (!All_Trendline_Alert &&(ObjectName(li_28) != High_TL_Name || ObjectName(li_28) != Low_TL_Name))continue;

  2. Ovo: And an advice: using variable names like "li_28" is sign of piracy (stolen code), avoid them.
    Variables like Li_28 are a sign of decompiled (pre-build 600) code.

    Decompiled code is stolen code. Either you are a thief, a fence, or the receiver of stolen (intellectual) property. Either way we will not be an accomplice after the fact to theft. See also http://forum.mql4.com/41864#490649

    If you post decompiled code again, you will likely be banned.

    Don't tell us you found it on the 'net: if someone stole your bank details and uploaded them on to the internet, is it OK for everyone to use them because "someone uploaded it, I don't know why I can't use that"?

    avatar
    1
    sakib134 2016.06.09 16:25 #
     

    same issue for me 

    For this line shows the warning "check operator precedence for possible error; use parentheses to clarify precedence"

    if (Ld_32 < 0.0 && Ld_44 > 0.0 && Ld_32 < 3.0 * ((-Ad_12) * Gd_352) || Ld_44 > 3.0 * (Ad_12 * Gd_352))

    Somebody please help me how to solve this.

    Thanks in advanced.. 

     

    avatar
    1211
    FMIC 2016.06.09 16:32 #
     
    sakib134:

    same issue for me 

    For this line shows the warning "check operator precedence for possible error; use parentheses to clarify precedence"

    if (Ld_32 < 0.0 && Ld_44 > 0.0 && Ld_32 < 3.0 * ((-Ad_12) * Gd_352) || Ld_44 > 3.0 * (Ad_12 * Gd_352))

    Somebody please help me how to solve this.

    Thanks in advanced.. 

    Were you too lazy to actually READ the 3 posts on this thread prior to your post?

    You are using decompiled (stolen code) and the title even gives you the answer to your problem - use parentheses to clarify precedence!

    avatar
    66
    jamescater 2016.06.10 15:16 #
     
    WHRoeder:
    1. This can be interpreted two different ways. Always use parentheses when mixing ands and ors.
    2. Ovo: And an advice: using variable names like "li_28" is sign of piracy (stolen code), avoid them.
      Variables like Li_28 are a sign of decompiled (pre-build 600) code.

      Decompiled code is stolen code. Either you are a thief, a fence, or the receiver of stolen (intellectual) property. Either way we will not be an accomplice after the fact to theft. See also http://forum.mql4.com/41864#490649

      If you post decompiled code again, you will likely be banned.

      Don't tell us you found it on the 'net: if someone stole your bank details and uploaded them on to the internet, is it OK for everyone to use them because "someone uploaded it, I don't know why I can't use that"?

      Good to see the moderators taking a strong stance against this on the forum.

      It's a shame that the  MQL5 team seem to have a more lax attitude to dodgy vendors "fencing" decompiled and stolen products on the marketplace.

      Back to topics list  

      To add comments, please log in or register