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 / 507
506  |  508
Subject: 
Modulo operator in NQC
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Thu, 30 Mar 2000 02:28:05 GMT
Viewed: 
2526 times
  
I'm trying to use the modulo operator in NQC, but I get an error that it
expects constants. I checked the docs and that indeed seems to be the
case. While I'm sure there must be instances where one would use
constants on both sides of the operator, I can't think of any. To not
allow variables seems to be eliminating the main usefulness of this
operator. Perhaps pointers are the answer. Does NQC support pointers?
Obviously I'm just learning about NQC.

Here is an example of what I'm trying to do:

var1 = var2 % 16;

Dennis

--
Dennis Williamson - Certified Y2K Complacent

Bad News: The next millenium starts on a Monday.
Good News: You get the day off.

(remove .NO and SPAM. to reply)



Message has 1 Reply:
  Re: Modulo operator in NQC
 
(...) The limitation is more historical than anything else. Originally expressions were all evaluated at compile time, which is why I have a bunch of operators (%, >>, <<) that have no corresponding bytecodes in the firmware. Over the last few (...) (25 years ago, 31-Mar-00, to lugnet.robotics.rcx.nqc)

2 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