Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible new bug

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Possible new bug

    Hi guys,

    I think that now even if we forget to put == in an if statement the compiler doesn't report the error.

    I spent the whole day figuring out why my new indicator that I just coded in NT7 was not returning expected value. I found out that instead of writing "==" in my if statement I wrote "=". The compiler didn't report the error so it seems that everything was all right.



    Bernard

    #2
    I could not comment on this for 2 reasons:
    - the compiler is from Microsoft .NET. Thus it would be beyond our control what it does. Also: We would not know what essentially changed between .NET 2.0 and .NET 3.5.
    - I would think that you could code statements in .NET 2.0 as well where if you left the second "=" it still would compile but of course the meaning would be different.

    Comment


      #3
      Anytime I forget the second = in NT6.5 the code will not compile.
      eDanny
      NinjaTrader Ecosystem Vendor - Integrity Traders

      Comment


        #4
        Originally posted by eDanny View Post
        Anytime I forget the second = in NT6.5 the code will not compile.
        if(x == 2) - true if x equals 2
        if (x = 2) - true is x was successfully assigned the value of 2.

        Correct me if I am wrong.

        Comment


          #5
          Guys, this is basic C# and definitely outside the scope of what we are able to provide support for (due to bandwidth reasons). I'm sure the web will hold tons of references on operators in C#. I suggest googling.

          However, here are some hints:
          - "if (x = 2)" will NEITHER compile on NT6.5 nor in NT7
          - I'm not aware of ANY constellation where "x=2" would yield true

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          47 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          23 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          33 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          51 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          42 views
          0 likes
          Last Post CarlTrading  
          Working...
          X