NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Miscellaneous Support > Historical Version 7 Beta Threads > Version 7 Beta General Questions & Bug Reports

Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports.

 
 
Thread Tools Display Modes
Old 10-07-2009, 02:42 PM   #1
blarouche
Senior Member
 
Join Date: Apr 2009
Posts: 198
Thanks: 0
Thanked 0 times in 0 posts
Default 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
blarouche is offline  
Old 10-07-2009, 10:51 PM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

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.
NinjaTrader_Dierk is offline  
Old 10-08-2009, 08:00 AM   #3
eDanny
Senior Member
 
eDanny's Avatar
 
Join Date: Jul 2008
Location: East Rochester, NY
Posts: 899
Thanks: 0
Thanked 19 times in 17 posts
Default

Anytime I forget the second = in NT6.5 the code will not compile.
eDanny is offline  
Old 10-08-2009, 07:37 PM   #4
roonius
Certified NinjaScript Consultant
 
Join Date: Oct 2008
Location: Chicago, IL
Posts: 523
Thanks: 0
Thanked 3 times in 3 posts
Send a message via Skype™ to roonius
Default

Quote:
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.
roonius is offline  
Old 10-08-2009, 10:19 PM   #5
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

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
NinjaTrader_Dierk is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 06:31 AM.