I have a project of several files with #defines to setup a conditional
compile. I would like to put these #defines in a single file and change the
conditional compile from this one file with the #defines using an "include
like" directive.
C# does not have a #include directive so it appears that I can not do this.
Am I missing something? Is it possible to do this in c#.
Thanks,
John Dolinka. 7 2325
You can mark classes, method properties etc with the Conditional attribute:
[Conditional("DE BUG")]
Or, you can use #define Whatever
HTH,
Bill
"John Dolinka" <jr*********@cd c.gov> wrote in message
news:Oy******** ******@TK2MSFTN GP11.phx.gbl... I have a project of several files with #defines to setup a conditional compile. I would like to put these #defines in a single file and change
the conditional compile from this one file with the #defines using an "include like" directive. C# does not have a #include directive so it appears that I can not do
this. Am I missing something? Is it possible to do this in c#. Thanks, John Dolinka.
You can mark classes, method properties etc with the Conditional attribute:
[Conditional("DE BUG")]
Or, you can use #define Whatever
HTH,
Bill
"John Dolinka" <jr*********@cd c.gov> wrote in message
news:Oy******** ******@TK2MSFTN GP11.phx.gbl... I have a project of several files with #defines to setup a conditional compile. I would like to put these #defines in a single file and change
the conditional compile from this one file with the #defines using an "include like" directive. C# does not have a #include directive so it appears that I can not do
this. Am I missing something? Is it possible to do this in c#. Thanks, John Dolinka.
Yes, but I have several cs files affected by the conditional compile. I
want to control the conditional compile from a single file. The problem is
the #define directive has to be the first "token" of any cs file, and there
is no provision for grouping defines across a project in a single file (at
least not that I am aware of).
Thanks for your response.
"William Ryan [eMVP]" <do********@com cast.nospam.net > wrote in message
news:uG******** ******@tk2msftn gp13.phx.gbl... You can mark classes, method properties etc with the Conditional
attribute: [Conditional("DE BUG")]
Or, you can use #define Whatever
HTH,
Bill "John Dolinka" <jr*********@cd c.gov> wrote in message news:Oy******** ******@TK2MSFTN GP11.phx.gbl... I have a project of several files with #defines to setup a conditional compile. I would like to put these #defines in a single file and change the conditional compile from this one file with the #defines using an
"include like" directive. C# does not have a #include directive so it appears that I can not do this. Am I missing something? Is it possible to do this in c#. Thanks, John Dolinka.
Yes, but I have several cs files affected by the conditional compile. I
want to control the conditional compile from a single file. The problem is
the #define directive has to be the first "token" of any cs file, and there
is no provision for grouping defines across a project in a single file (at
least not that I am aware of).
Thanks for your response.
"William Ryan [eMVP]" <do********@com cast.nospam.net > wrote in message
news:uG******** ******@tk2msftn gp13.phx.gbl... You can mark classes, method properties etc with the Conditional
attribute: [Conditional("DE BUG")]
Or, you can use #define Whatever
HTH,
Bill "John Dolinka" <jr*********@cd c.gov> wrote in message news:Oy******** ******@TK2MSFTN GP11.phx.gbl... I have a project of several files with #defines to setup a conditional compile. I would like to put these #defines in a single file and change the conditional compile from this one file with the #defines using an
"include like" directive. C# does not have a #include directive so it appears that I can not do this. Am I missing something? Is it possible to do this in c#. Thanks, John Dolinka.
Right-click on the project and select properties. Select Configuration
Properties and the first property is Conditional Compilation Constants.
This is where you define them in C#.
Pete
-- http://www.petedavis.net
"John Dolinka" <jr*********@cd c.gov> wrote in message
news:eX******** ******@tk2msftn gp13.phx.gbl... Yes, but I have several cs files affected by the conditional compile. I want to control the conditional compile from a single file. The problem
is the #define directive has to be the first "token" of any cs file, and
there is no provision for grouping defines across a project in a single file (at least not that I am aware of). Thanks for your response.
"William Ryan [eMVP]" <do********@com cast.nospam.net > wrote in message news:uG******** ******@tk2msftn gp13.phx.gbl... You can mark classes, method properties etc with the Conditional attribute: [Conditional("DE BUG")]
Or, you can use #define Whatever
HTH,
Bill "John Dolinka" <jr*********@cd c.gov> wrote in message news:Oy******** ******@TK2MSFTN GP11.phx.gbl... I have a project of several files with #defines to setup a conditional compile. I would like to put these #defines in a single file and
change the conditional compile from this one file with the #defines using an "include like" directive. C# does not have a #include directive so it appears that I can not do
this. Am I missing something? Is it possible to do this in c#. Thanks, John Dolinka.
Right-click on the project and select properties. Select Configuration
Properties and the first property is Conditional Compilation Constants.
This is where you define them in C#.
Pete
-- http://www.petedavis.net
"John Dolinka" <jr*********@cd c.gov> wrote in message
news:eX******** ******@tk2msftn gp13.phx.gbl... Yes, but I have several cs files affected by the conditional compile. I want to control the conditional compile from a single file. The problem
is the #define directive has to be the first "token" of any cs file, and
there is no provision for grouping defines across a project in a single file (at least not that I am aware of). Thanks for your response.
"William Ryan [eMVP]" <do********@com cast.nospam.net > wrote in message news:uG******** ******@tk2msftn gp13.phx.gbl... You can mark classes, method properties etc with the Conditional attribute: [Conditional("DE BUG")]
Or, you can use #define Whatever
HTH,
Bill "John Dolinka" <jr*********@cd c.gov> wrote in message news:Oy******** ******@TK2MSFTN GP11.phx.gbl... I have a project of several files with #defines to setup a conditional compile. I would like to put these #defines in a single file and
change the conditional compile from this one file with the #defines using an "include like" directive. C# does not have a #include directive so it appears that I can not do
this. Am I missing something? Is it possible to do this in c#. Thanks, John Dolinka.
Thanks! That did the trick.
"Pete Davis" <pd******@hotma il.com> wrote in message
news:03******** *************** *******@news.me ganetnews.com.. . Right-click on the project and select properties. Select Configuration Properties and the first property is Conditional Compilation Constants.
This is where you define them in C#.
Pete -- http://www.petedavis.net
"John Dolinka" <jr*********@cd c.gov> wrote in message news:eX******** ******@tk2msftn gp13.phx.gbl... Yes, but I have several cs files affected by the conditional compile. I want to control the conditional compile from a single file. The problem is the #define directive has to be the first "token" of any cs file, and there is no provision for grouping defines across a project in a single file
(at least not that I am aware of). Thanks for your response.
"William Ryan [eMVP]" <do********@com cast.nospam.net > wrote in message news:uG******** ******@tk2msftn gp13.phx.gbl... You can mark classes, method properties etc with the Conditional attribute: [Conditional("DE BUG")]
Or, you can use #define Whatever
HTH,
Bill "John Dolinka" <jr*********@cd c.gov> wrote in message news:Oy******** ******@TK2MSFTN GP11.phx.gbl... > I have a project of several files with #defines to setup a
conditional > compile. I would like to put these #defines in a single file and
change the > conditional compile from this one file with the #defines using an
"include > like" directive. > > > > C# does not have a #include directive so it appears that I can not
do this. > Am I missing something? Is it possible to do this in c#. > > > > Thanks, > > > > John Dolinka. > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: John Dolinka |
last post by:
I have a project of several files with #defines to setup a conditional
compile. I would like to put these #defines in a single file and change the
conditional compile from this one file with the #defines using an "include
like" directive.
C# does not have a #include directive so it appears that I can not do this.
Am I missing...
|
by: Robert W. |
last post by:
I have a library that I'd like to have both a WinForms app and a CF app
utilize. Generally the code is very compatible but sometimes there are some
differences.
At first I thought I could use conditional statements like #if (POCKETPC),
#else, and #endif to differentiate different code constructs but then I
learned that these only take...
|
by: SStory |
last post by:
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,
|
by: Trapulo |
last post by:
I'm using conditonal compile with statement #IF CONFIG
This works if I use #IF CONFIG = "Debug" or #IF CONFIG= "Release"
But if I define an other compilation profile, eg. "BestRelease", and I use
#IF CONFIG = "BestRelease", compiler doesn't recognize the true condition
and doesn't compile statements inside #IF... #END IF block.
Is this a...
|
by: Torben Laursen |
last post by:
Hi
Often I just want to compile one c++ file in a project the check it for
errors.
Now I can right click on a *.cpp file and select "Compile"
But is there a way and short cut to compile a file of any type. luke *.cc,
*.h, *hpp
Thanks Torben
| |
by: kalaivanan |
last post by:
hi,
how should i compile csharp programs in the cmd command prompt without
being installing visual studio .net. I have installed framework 1.1
and sdk. also i have executed the vsvars32 btach file. still iam not
able to compile the csharp file. the error generated is:
csc is not recognized as internal or external command.
But in another...
|
by: naunetr |
last post by:
hello all,
i wrote the small program below to practice conditional compiling. if i
define MYSYMBOL then everthing works fine, but when i comment MYSYMBOL
gcc gives the following message:
cnd_compile01.c:4:2: error: #error "Error"
cnd_compile01.c:1: warning: ISO C forbids an empty source file
i cant understand the warning and how to...
|
by: Torben Laursen |
last post by:
Hi
Is it possible to write a macro that compiles a file set (cpp/h).
I can find it on the menu if I right click on a cpp file but it would be
nice to just have a
macro that I could call using a shortcut.
Can anyone show me what that macro should look like?
Thanks Torben
|
by: pereges |
last post by:
By main file, I mean the one which contains the main routine. Can some
one please provide suggestions as to how I can improve the
organization of main file ? I have just though about a rough skeleton.
In my ray tracing project, I have to carry out following task (in
sequence)
1. Read the mesh from an ascii file and store it in the mesh...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| | |