Subject:
|
Re: Expression limitations w/bytecode
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 19 Jan 1999 04:24:03 GMT
|
Viewed:
|
1199 times
|
| |
| |
One more note on arithmetic...
The firmware supports operations where the second operand is either a
constant or a variable, but not other sources (such as input values,
timers, etc). Present versions of NQC don't check this, so code like "a
-= IN_1;" will compile, but not run correctly. This has been fixed in the
NQC source, so the next release will generate a compiler error for the
above line (as opposed to generating incorrect code).
Dave
In article <13987.60895.429965.999847@perdix.acsu.buffalo.edu>, "Matthew
D. Stock" <stock@perdix.acsu.buffalo.edu> wrote:
> Dave Baum writes:
> > The firmware does support basic arithmetic operations. You can use them
> > in NQC like this...
>
> Ah, my mistake. I had tried something like "if (a - b > 20)" using NQC,
> and it failed. I referred to the docs, and my read of the expression stuff
> seemed to tell me that something like you describe wasn't valid. I had
> interpreted "var -= value" to mean that you could add and subtract
> constants, but not other variables.
>
> I'm better now. :-)
> Thanks again!
> -Matt
> --
> Did you check the web site first?: http://www.crynwr.com/lego-robotics
--
reply to: dbaum at enteract dot com
|
|
Message is in Reply To:
| | Re: Expression limitations w/bytecode
|
| Dave Baum writes: > The firmware does support basic arithmetic operations. You can use them > in NQC like this... Ah, my mistake. I had tried something like "if (a - b > 20)" using NQC, and it failed. I referred to the docs, and my read of the (...) (26 years ago, 19-Jan-99, to lugnet.robotics)
|
7 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|