Shop OBEX P1 Docs P2 Docs Learn Events
Conditional code — Parallax Forums

Conditional code

mynet43mynet43 Posts: 644
edited 2007-04-25 02:59 in Propeller 1
Is there a command like #ifdef in C that allows conditional compilation of the spin code?

I have a test routine as well as a DAT block of test data in my program that I'd like to include only when I'm testing.

Thanks for your help.

Jim

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-04-24 23:42
    With·a routine you can use a regular if statement in coordination with a constant, ie:

    CON
    debug = 1

    ...
    if debug ...


    there is no means for conditionally including data or objects.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • mynet43mynet43 Posts: 644
    edited 2007-04-25 02:59
    Thanks, that's what I figured, since I couldn't find it in the manual.
Sign In or Register to comment.