473,385 Members | 1,780 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,385 software developers and data experts.

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
"
Nov 15 '05 #1
2 1327
Hi

You can use Compile time attributes. Check the followig
url
http://www.devx.com/dotnet/Article/11579/0/page/4

HTH
Ravikanth[MVP]

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

Nov 15 '05 #2
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.

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

--
Greg Ewing [MVP]
http://www.citidc.com

"Yosi" <yo*****@taux01.nsc.com> wrote in message
news:1a*****************************@phx.gbl...
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
"

Nov 15 '05 #3

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

Similar topics

1
by: twins | last post by:
Hi, Iam wondering if there is any method to do the following: 1) When a file is created in a directory in local computer. 2) When the mysql date stored in the DB approaches the current date and...
5
by: GIMME | last post by:
One of my coworkers insists that one should never use static methods because race conditions exist. Thinking along the lines that all variable assignments are assignments to static variables. ...
65
by: PengYu.UT | last post by:
Hi, Sometimes, I write = instead of == in if conditions by mistakes. Is there any way the gcc compiler can give me a warning? Best wishes, Peng
5
by: Uday Deo | last post by:
Hi everyone, I am looping through 4 nested loops and I would like to break in the inner most loop on certain condition and get the control on the 2 nd loop instead of 3rd loop. Here is briefly...
24
by: Kunal | last post by:
Hello, I need help in removing if ..else conditions inside for loops. I have used the following method but I am not sure whether it has actually helped. Below is an example to illustrate what I...
14
by: Urs Thuermann | last post by:
What is the most elegant way to check certain conditions at compile time? I.e. I want a compile time error to be generated if for example the size of a struct is not a multiple of 4 or if one...
3
by: Erland Sommarskog | last post by:
I've uploaded a new version of my article on Dynamic Search Conditions on http://www.sommarskog.se/dyn-search.html. I've revised the article to cover SQL 2005, and made a general overhaul of the...
12
by: =?ISO-8859-1?Q?Ren=E9?= | last post by:
Hi, is there a rule of thumb what is better/faster/more performant in SQL Server 2005? a) SELECT * FROM A INNER JOIN B ON B.ID = A.ID AND B.Cond1 = 1 AND B.Cond2 = 2 b) SELECT * FROM A INNER...
0
by: moltendorf | last post by:
I've been trying to find a suitable method for preventing race conditions in my own code. Currently I'm using a file and the flock function to prevent code in other threads from executing at the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.