Shop OBEX P1 Docs P2 Docs Learn Events
conditional compiler directives — Parallax Forums

conditional compiler directives

bob kruggelbob kruggel Posts: 50
edited 2009-05-04 14:39 in General Discussion
I'm new to SXB. I keep reading about, and seeing "examples" of conditional compiler directives. However I don't find reference to them in any documentation about SXB or the IDE. It's obvious to me that I don't understand conditional compiler directives at all, even though I thought I did. Can· someone help me to end the confusion?
BobK·· confused.gif

Comments

  • RS_JimRS_Jim Posts: 1,771
    edited 2009-05-02 11:21
    BobK
    Read the what's new in the above stickey thread about SXB 2.0 Beta. You will find a lot of information about conditional compiler directives. If you type ifdef into Help there is some more info on conitional directives. I hope this helps.
    RS_Jim
  • ZootZoot Posts: 2,227
    edited 2009-05-04 14:39
    e.g.

    
    '{$DEFINE UsePortC}
    
    '{$IFDEF UsePortC}
    serialOut PIN RC.0
    '{$ELSE}
    serialOut PIN RB.0
    '{$ENDIF}
    
    
    



    If you remove the DEFINE line, then the program will compile with RB.0 as the serial out pin, otherwise RC.0 will be the pin. Just an example, of course.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
Sign In or Register to comment.