473,395 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Conditionaly compile

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

------------------------------
Nov 20 '05 #1
4 1014
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" <Cr****@datagroup.ro> wrote in message
news:ug**************@TK2MSFTNGP11.phx.gbl...
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

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

Nov 20 '05 #2
"Crirus" <Cr****@datagroup.ro> 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

Nov 20 '05 #3
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" <hu*********@hotmail.com> wrote in message
news:e4**************@TK2MSFTNGP12.phx.gbl...
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" <Cr****@datagroup.ro> wrote in message
news:ug**************@TK2MSFTNGP11.phx.gbl...
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

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


Nov 20 '05 #4
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" <Cr****@datagroup.ro> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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" <hu*********@hotmail.com> wrote in message
news:e4**************@TK2MSFTNGP12.phx.gbl...
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" <Cr****@datagroup.ro> wrote in message
news:ug**************@TK2MSFTNGP11.phx.gbl...
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

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



Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: janeaustine50 | last post by:
Python's InteractiveInterpreter uses the built-in compile function. According to the ref. manual, it doesn't seem to concern about the encoding of the source string. When I hand in an unicode...
5
by: Carmine Cairo | last post by:
Hi, I'm working on a project and today I've note a little problem during the compile fase. Here a little piece of code: // 1st version welldone = 0; size = p->getSize(); backbone = new...
5
by: Brice Prunier | last post by:
Here under 4 schemas i'm working with ( it may be long: sorry...) The context is the following : Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous schema: no TargetNamespace )...
10
by: Chris LaJoie | last post by:
Our company has been developing a program in C# for some time now, and we haven't had any problems with it, but just last night something cropped up that has me, and everyone else, stumped. I...
15
by: steve yee | last post by:
i want to detect if the compile is 32 bits or 64 bits in the source code itself. so different code are compiled respectively. how to do this?
16
by: desktop | last post by:
I have read that using templates makes types know at compile time and using inheritance the types are first decided at runtime. The use of pointers and casts also indicates that the types will...
1
by: brianrpsgt1 | last post by:
Newbie here.... I have been able to successful pull info from a MySQL DB, get the results and output them in an HTML format using Cheetah to the screen using IDLE. I am doing this on a Windows...
3
by: NvrBst | last post by:
Right now I have C99 code in .c extensions. I compile it in VSC++ and it complains about a lot of errors. I change the extensions to .cpp and compile in VSC++ and it succeeds. Is there a way...
6
by: Ed Leafe | last post by:
I've noticed an odd behavior with compile() and code that does not contain a trailing newline: if the last line is a comment inside of any block, a syntax error is thrown, but if the last line is a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.