| | NXC - embedded functions failed Elizabeth Mabrey
|
| | #include "NXCDefs.h" int Max(int a,int b){ if (a>b) return a; else return b; } task main(){ int Prob=0; Prob = Max(33, Max(5,15)); NumOut(5,LCD_LINE2,false,Prob); //returns 15 WRONG ---...--- Prob = Max(5,15); Prob = Max(33,Prob); (...) (18 years ago, 20-May-07, to lugnet.robotics.nxt)
|
| | |
| | | | Re: NXC - embedded functions failed John Hansen
|
| | | | (...) This is definitely a problem in NXC. The problem is that the value of arg "a" (33) to the function Max is being replaced during the second call to Max since it passes 5 into arg "a". It looks like I need to figure out a decent way to implement (...) (18 years ago, 21-May-07, to lugnet.robotics.nxt)
|
| | | | |
| | | | RE: NXC - embedded functions failed Elizabeth Mabrey
|
| | | | Hi John, Will throwing in a compilation error be a viable option? --Elizabeth -----Original Message----- From: news-gateway@lugnet.com [mailto:news-gateway...ugnet.com] On Behalf Of Elizabeth Mabrey Sent: Sunday, May 20, 2007 1:19 PM To: (...) (18 years ago, 21-May-07, to lugnet.robotics.nxt)
|
| | | | |
| | | | | | Re: NXC - embedded functions failed John Hansen
|
| | | | (...) I think having NXC generate a compiler error is a great idea. :-) I will work that into the next beta release (b30). I just released beta 29 today. It has a number of important fixes and enhancements but I just noticed that it has a few new (...) (18 years ago, 22-May-07, to lugnet.robotics.nxt)
|
| | | | |