Conditions at Compile time

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yosi

    Conditions at Compile time

    Hi,
    I wondering if there is any whay to add some conditions to
    my code which used on the compile run time,
    as on C++/C
    "
    #ifdef DEBUG
    UI ui("AppDBG> ");
    #else
    UI ui("App> ");
    #endif
    "
  • Ravikanth[MVP]

    #2
    Conditions at Compile time

    Hi

    You can use Compile time attributes. Check the followig
    url


    HTH
    Ravikanth[MVP]

    [color=blue]
    >-----Original Message-----
    >Hi,
    >I wondering if there is any whay to add some conditions[/color]
    to[color=blue]
    >my code which used on the compile run time,
    >as on C++/C
    >"
    >#ifdef DEBUG
    >UI ui("AppDBG> ");
    >#else
    >UI ui("App> ");
    >#endif
    >"
    >.
    >[/color]

    Comment

    • Greg Ewing [MVP]

      #3
      Re: Conditions at Compile time

      Yosi, yes you can. The syntax is slightly different though. You need to
      use #if. #else, and #endif. Here's a list of C# preprocessor directives.



      --
      Greg Ewing [MVP]
      Accomplish Your Mission with Better IT | IT support for nonprofits. You deserve peace of mind. National and remote outsourced nonprofit IT.


      "Yosi" <yousefk@taux01 .nsc.com> wrote in message
      news:1ae9101c38 7f0$614c5880$a6 01280a@phx.gbl. ..[color=blue]
      > Hi,
      > I wondering if there is any whay to add some conditions to
      > my code which used on the compile run time,
      > as on C++/C
      > "
      > #ifdef DEBUG
      > UI ui("AppDBG> ");
      > #else
      > UI ui("App> ");
      > #endif
      > "[/color]


      Comment

      Working...