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 / 1179
1178  |  1180
Subject: 
SetWatch() only accepts constants
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Tue, 7 Aug 2001 03:12:21 GMT
Viewed: 
2183 times
  
I just wrote a task and function that cause the RCX to receive data from the
PC and then set the time on the RCX using SetWatch().  Unfortunately, I
didn't realize that SetWatch() only accepts constants.  NQC complained when
integer variables were passed.  Is this because the special SetWatch()
opcode only accepts embedded constants and not references to memory
variables?  That probably is what is going on, but if not, would it be
possible to change it so it can accept variables?

It sure would have been useful to set the system time from the computer.  It
doesn't make a lot of sense to have a function that sets the system time
only except an embedded constant.  "You must only run this program at
Midnight for the system time to be set properly."



Message has 3 Replies:
  RE: SetWatch() only accepts constants
 
Instead of sending ByteCodes from the PC and getting the RCX to interpret them, you can construct and send the SetWatch() OpCode plus the correct "constant" time and send it through Spirit.OCX (or directly, depending of the platform). (...) (23 years ago, 7-Aug-01, to lugnet.robotics.rcx.nqc)
  Re: SetWatch() only accepts constants
 
(...) You can use the NQC -watch now command to set the time. Dean (23 years ago, 7-Aug-01, to lugnet.robotics.rcx.nqc)
  Re: SetWatch() only accepts constants
 
(...) Sorry, the opcode requires constants - there's not much NQC can do (aside from generating an enormous switch statement). Dave (23 years ago, 8-Aug-01, to lugnet.robotics.rcx.nqc)

4 Messages in This Thread:



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

Custom Search

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