Subject:
|
Re: Blocking SetUserDisplay?
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Sun, 5 Jun 2005 23:28:54 GMT
|
Viewed:
|
5328 times
|
| |
| |
In lugnet.robotics.rcx.nqc, John Hansen wrote:
> In lugnet.robotics.rcx.nqc, Ross Crawford wrote:
> > I can work around it by doing:
> >
> > b = x * 100 + y;
> > a = b;
> >
> > but I was wondering if there's any other way to either force NQC to use
> > temporary space for calculations, or force the display routine to block until
> > the calculations are complete?
>
> You may be able to work around this by using parenthesis (untested).
>
> a = ((x * 100) + y);
>
> or you might try
>
> a = 0 + ((x * 100) + y);
Thanks for the ideas! Actually these yielded some interesting results:
a = 0 + ((x * 100) + y); occasionally yielded 0 (as expected), but never yielded
anything other than 0 and the correct value (that I saw).
a = ((x * 100) + y); and a = (x * 100 + y); seemed to improve things, they never
produced just x, but occasionally produced x*100, although much less often than
the no bracket version (using my admittedly inaccurate statistical "analysis").
So all that goes to show I have no idea how it handles calculations/assignments
like that, and I should stick to using the temporary variable ;)
ROSCO
|
|
Message is in Reply To:
6 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|