![]() |
|
|||||||
| Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Apr 2009
Posts: 198
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
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.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jul 2008
Location: East Rochester, NY
Posts: 899
Thanks: 0
Thanked 19 times in 17 posts
|
Anytime I forget the second = in NT6.5 the code will not compile.
|
|
|
|
|
|
#4 | |
|
Certified NinjaScript Consultant
|
Quote:
if (x = 2) - true is x was successfully assigned the value of 2. Correct me if I am wrong. |
|
|
|
|
|
|
#5 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
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
Dierk
NinjaTrader Customer Service |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bug | murfinp | Strategy Development | 9 | 05-05-2009 02:32 PM |
| Bug | blarouche | Indicator Development | 6 | 04-20-2009 11:58 AM |
| Is it a bug? | Baruch | Strategy Development | 5 | 04-13-2009 11:29 AM |
| Bug still there... | skynetman | Suggestions And Feedback | 2 | 05-20-2008 06:29 AM |
| possible bug | woodside | Strategy Analyzer | 1 | 10-31-2007 11:44 AM |