To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 19939
    Brick Constants in NQC/Bricx —Paulo Sergio Tesche
   Are there predefined constants generated by Bricx or NQC that identifies the Brick (RCX, SCout ...) to wich the generated code is targeted for? It would be really usefull to write "multi-Brick" code in a single source trough the use of #ifdef. Paulo (...) (21 years ago, 8-Jan-03, to lugnet.robotics)
   
        Re: Brick Constants in NQC/Bricx —Brian B. Alano
     See (URL) (but don't get your hopes up). (...) (21 years ago, 8-Jan-03, to lugnet.robotics)
    
         Re: Brick Constants in NQC/Bricx —Paulo Sergio Tesche
     (...) Thanks Brian, but I´m looking for ways to determine the brick at compile time, not at runtime, since the generated code must match the target API. (21 years ago, 8-Jan-03, to lugnet.robotics)
   
        Re: Brick Constants in NQC/Bricx —Steve Baker
   (...) Yes - I don't know about Bricx - but the NQC example programs contain one that says: #ifdef __RCX ...and (more significantly) the system file 'compiler/rcx2.nqh' contains #if __RCX==2 #if defined(__SCOUT) ...and a bunch of other defines (...) (21 years ago, 8-Jan-03, to lugnet.robotics)
   
        Re: Brick Constants in NQC/Bricx —Dave Baum
   __SCOUT and __RCX behave as you guessed. There are also defines for __CM and __SPY for spybotics and cybermaster targets, respectively. These constants should work for BricxCC, or any other NQC environment since they are defined by the NQC compiler. (...) (21 years ago, 9-Jan-03, to lugnet.robotics)
 

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