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 / 1771
1770  |  1772
Subject: 
Re: Blocking SetUserDisplay?
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Sun, 5 Jun 2005 04:49:29 GMT
Viewed: 
10811 times
  
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);


John Hansen
http://bricxcc.sourceforge.net/nqc/



Message has 2 Replies:
  Re: Blocking SetUserDisplay?
 
(...) Neither of these work, although the second one does introduce a temporary for everything except for the 0 part. It will result in the display sometimes showing a value of zero. NQC tries really hard to use as few variables as it can so you (...) (21 years ago, 5-Jun-05, to lugnet.robotics.rcx.nqc)
  Re: Blocking SetUserDisplay?
 
(...) 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 * (...) (21 years ago, 5-Jun-05, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  Blocking SetUserDisplay?
 
I have a program with a setup routine for calibrating light sensors. During the setup routine, it does: SetUserDisplay (a, 2); Then in a loop, reads the values of 2 light sensors into x & y, averages the readings and then does: a = x * 100 + y; to (...) (21 years ago, 4-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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

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