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 / 1412
  Program() always returns 0
 
The following code always displays 0 regardless of the program slot in which it is run. Is this a bug, or do I not understand the purpose of Program()? I'm using the 2.0 firmware and NQC 2.4 r2. task main() { SetUserDisplay(Program(),0); (...) (22 years ago, 6-May-02, to lugnet.robotics.rcx.nqc)
 
  Re: Program() always returns 0
 
SetUserDisplay does not work like that. You need to specify either a sensor, timer, or global variable. Once you have done that it will continuously update the display as the value changes. In your case you should write your program something like: (...) (22 years ago, 6-May-02, to lugnet.robotics.rcx.nqc)
 
  Re: Program() always returns 0
 
Oops. Looks like a bug in the NQC API file. I just fixed the bug in the NQC source, but it's not major enough to warrant a new release yet. In the meantime, you can add the following lines to the top of of your source file as a work-around: #undef (...) (22 years ago, 8-May-02, to lugnet.robotics.rcx.nqc)
 
  Re: Program() always returns 0
 
I believe any data source (not just timers/sensors/variables) can be used in SetUserDisplay. The big limitation is that local variables cannot be used since the display is updated in a global context independent of the tasks. If you know of data (...) (22 years ago, 8-May-02, to lugnet.robotics.rcx.nqc)

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