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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          605 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          351 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          560 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          561 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X