Conditional Compilation

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

    #1

    Conditional Compilation

    Is there a #define equivalent for VB.NET? I'm wanting to begin
    implementation of a new feature in my software, but to hide it in release
    builds until it's ready. Any ideas?



  • AMercer

    #2
    RE: Conditional Compilation

    > Is there a #define equivalent for VB.NET? I'm wanting to begin[color=blue]
    > implementation of a new feature in my software, but to hide it in release
    > builds until it's ready. Any ideas?[/color]

    If all you want to do is differentiate between debug and release versions,
    then:

    #If DEBUG Then
    ' stuff you want to hide
    #End If

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Conditional Compilation

      "Robin Tucker" <nonono@nomeans no.com> schrieb:[color=blue]
      > Is there a #define equivalent for VB.NET? I'm wanting to begin
      > implementation of a new feature in my software, but to hide it in release
      > builds until it's ready.[/color]

      Visual Basic Language Reference -- Directives
      <URL:http://msdn.microsoft. com/library/en-us/vblr7/html/vaoridirectives vba.asp>

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • Robin Tucker

        #4
        Re: Conditional Compilation

        Ahhh superb. Thanks.

        "AMercer" <AMercer@discus sions.microsoft .com> wrote in message
        news:938D1A67-6669-4E4B-A35A-004B8503FAD0@mi crosoft.com...[color=blue][color=green]
        >> Is there a #define equivalent for VB.NET? I'm wanting to begin
        >> implementation of a new feature in my software, but to hide it in release
        >> builds until it's ready. Any ideas?[/color]
        >
        > If all you want to do is differentiate between debug and release versions,
        > then:
        >
        > #If DEBUG Then
        > ' stuff you want to hide
        > #End If
        >[/color]


        Comment

        • Jay B. Harlow [MVP - Outlook]

          #5
          Re: Conditional Compilation

          Robin,
          In addition to #If DEBUG Then

          There is also a Conditional attribute which I find handy.

          <Conditional("D EBUG")> _
          Public Sub Test()
          End Sub

          The Test sub will always be created, however it will conditionally be called
          based on whether its a DEBUG build or not.

          http://msdn.microsoft.com/library/de...classtopic.asp

          http://msdn.microsoft.com/library/de...pec_17_4_2.asp

          --
          Hope this helps
          Jay [MVP - Outlook]
          ..NET Application Architect, Enthusiast, & Evangelist
          T.S. Bradley - http://www.tsbradley.net


          "Robin Tucker" <nonono@nomeans no.com> wrote in message
          news:dk8400$a6c $1$830fa17d@new s.demon.co.uk.. .
          | Is there a #define equivalent for VB.NET? I'm wanting to begin
          | implementation of a new feature in my software, but to hide it in release
          | builds until it's ready. Any ideas?
          |
          |
          |


          Comment

          Working...