PC Review


Reply
Thread Tools Rate Thread

Conditionaly compile

 
 
Crirus
Guest
Posts: n/a
 
      11th Dec 2003
I need a code to be considered only when I test something...
How to declare a compile constant..?

--
Cheers,
Crirus

------------------------------
If work were a good thing, the boss would take it all from you

------------------------------


 
Reply With Quote
 
 
 
 
Codemonkey
Guest
Posts: n/a
 
      11th Dec 2003
You can use the built in Debug constant to test when compiled in to debug
mode instead of release mode.

E.g.

#If DEBUG Then

'Do debugging code

#End If

If you need to define your own constant, go to the project properties ->
Configuration Properties -> Build and insert any custom constants you need
at the bottom of the page.

Hope this helps.

Trev.

"Crirus" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I need a code to be considered only when I test something...
> How to declare a compile constant..?
>
> --
> Cheers,
> Crirus
>
> ------------------------------
> If work were a good thing, the boss would take it all from you
>
> ------------------------------
>
>



 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      11th Dec 2003
"Crirus" <(E-Mail Removed)> schrieb
> I need a code to be considered only when I test something...
> How to declare a compile constant..?



http://msdn.microsoft.com/library/en...tionPortal.asp


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
Crirus
Guest
Posts: n/a
 
      11th Dec 2003
Found a better way

#const MyConst=True

..
..
..
#If MyConst Then

conditional code here

#EndIf

--
Cheers,
Crirus

------------------------------
If work were a good thing, the boss would take it all from you

------------------------------

"Codemonkey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You can use the built in Debug constant to test when compiled in to debug
> mode instead of release mode.
>
> E.g.
>
> #If DEBUG Then
>
> 'Do debugging code
>
> #End If
>
> If you need to define your own constant, go to the project properties ->
> Configuration Properties -> Build and insert any custom constants you need
> at the bottom of the page.
>
> Hope this helps.
>
> Trev.
>
> "Crirus" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I need a code to be considered only when I test something...
> > How to declare a compile constant..?
> >
> > --
> > Cheers,
> > Crirus
> >
> > ------------------------------
> > If work were a good thing, the boss would take it all from you
> >
> > ------------------------------
> >
> >

>
>



 
Reply With Quote
 
Codemonkey
Guest
Posts: n/a
 
      11th Dec 2003
It might be handier than going through the project properties to set the
constant, but if you set it in the properties, you can specify different
values for different build configurations (e.g. DEBUG only exists in the
debug configuration, not the release configuration.


"Crirus" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Found a better way
>
> #const MyConst=True
>
> .
> .
> .
> #If MyConst Then
>
> conditional code here
>
> #EndIf
>
> --
> Cheers,
> Crirus
>
> ------------------------------
> If work were a good thing, the boss would take it all from you
>
> ------------------------------
>
> "Codemonkey" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > You can use the built in Debug constant to test when compiled in to

debug
> > mode instead of release mode.
> >
> > E.g.
> >
> > #If DEBUG Then
> >
> > 'Do debugging code
> >
> > #End If
> >
> > If you need to define your own constant, go to the project properties ->
> > Configuration Properties -> Build and insert any custom constants you

need
> > at the bottom of the page.
> >
> > Hope this helps.
> >
> > Trev.
> >
> > "Crirus" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > I need a code to be considered only when I test something...
> > > How to declare a compile constant..?
> > >
> > > --
> > > Cheers,
> > > Crirus
> > >
> > > ------------------------------
> > > If work were a good thing, the boss would take it all from you
> > >
> > > ------------------------------
> > >
> > >

> >
> >

>
>



 
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
add cells conditionaly not in continuous row or column =?Utf-8?B?bG9nYW5pbmM2?= Microsoft Excel Misc 3 11th Nov 2005 03:32 AM
Formating a cell conditionaly =?Utf-8?B?REI=?= Microsoft Excel Worksheet Functions 1 14th Oct 2005 08:45 PM
How to Conditionaly Set Cmd button Focus =?Utf-8?B?QWx2aW4=?= Microsoft Access Form Coding 6 9th Aug 2005 12:53 AM
How can I conditionaly suppress my report header? Dave Microsoft Access Reports 2 10th May 2005 02:50 PM
Need to print different sheets conditionaly Georgee Microsoft Excel Programming 2 17th Aug 2004 06:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:03 PM.