PC Review


Reply
Thread Tools Rate Thread

Conditional compile based upon Active Configuration

 
 
SStory
Guest
Posts: n/a
 
      5th Sep 2003
I would like to have some code compile if my Active Configuration is set to
debug and not compile if it is set to Release.

I don't want to have to remember to define a constant. I just want to
change configurations and all debug code not execute.

How is this possible.

Thanks in advance,

Shane


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      5th Sep 2003
"SStory" <(E-Mail Removed)> schrieb:
> I would like to have some code compile if my Active
> Configuration is set to debug and not compile if it
> is set to Release.
>
> I don't want to have to remember to define a constant.
> I just want to change configurations and all debug code
> not execute.


\\\
#If Debug Then
...
#End If
///

Select the project in the project explorer, select the "Project" menu ->
"Properties" -> "Configuration Settings" -> "Build" -> "Define DEBUG
constant" (translated from the German language version of VS.NET 2002).

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>


 
Reply With Quote
 
SStory
Guest
Posts: n/a
 
      5th Sep 2003
cool , I found it.
Thre is a checkbox that says Defin Debug Constant already checked in the
debug configuration.
That is what I wanted to do.

I can't always remember to define one. This will be helpful. Keep me from
burning a CD with Debug code still in.

Danke Herr Wagner, Guten Aben (I think good evening... not sure.... I
remember, Guten Morgan,Guten tag, Guten Aben...)

Shane


"Herfried K. Wagner [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "SStory" <(E-Mail Removed)> schrieb:
> > I would like to have some code compile if my Active
> > Configuration is set to debug and not compile if it
> > is set to Release.
> >
> > I don't want to have to remember to define a constant.
> > I just want to change configurations and all debug code
> > not execute.

>
> \\\
> #If Debug Then
> ...
> #End If
> ///
>
> Select the project in the project explorer, select the "Project" menu ->
> "Properties" -> "Configuration Settings" -> "Build" -> "Define DEBUG
> constant" (translated from the German language version of VS.NET 2002).
>
> --
> Herfried K. Wagner
> MVP · VB Classic, VB.NET
> <http://www.mvps.org/dotnet>
>
>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      5th Sep 2003
"SStory" <(E-Mail Removed)> schrieb:
> Danke Herr Wagner, Guten Aben (I think good evening... not sure.... I
> remember, Guten Morgan,Guten tag, Guten Aben...)


"Guten Abend", "Guten Tag", "Guten Morgen"

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Statement based on active control Don Microsoft Access Form Coding 4 19th Apr 2009 08:10 PM
Conditional execution based on app configuration John Microsoft Dot NET 2 28th Mar 2009 04:32 PM
Conditional execution based on app configuration John Microsoft VB .NET 2 28th Mar 2009 04:32 PM
Conditional statement based on active form =?Utf-8?B?TWlrZQ==?= Microsoft Access Macros 1 16th Sep 2005 10:37 PM
Checking active solution configuration at compile time =?Utf-8?B?TWljaGFlbA==?= Microsoft VC .NET 3 28th Jun 2004 11:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:31 AM.