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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          164 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          318 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          246 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          350 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          179 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X