To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 1772
1771  |  1773
Subject: 
Re: Blocking SetUserDisplay?
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Sun, 5 Jun 2005 23:28:54 GMT
Viewed: 
10821 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:
  Re: Blocking SetUserDisplay?
 
(...) 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); John Hansen (URL) (21 years ago, 5-Jun-05, to lugnet.robotics.rcx.nqc)

6 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR