On Mon, 20 Feb 2006 12:38:05 -0600, "Greg Smith" <gj*@umn.edu> wrote:
Can that be done?
No. You can set pre-processor symbols which are defined throughout the
project (in VS.NET at least) but those don't have values.
Why do you not want to use "const" as already suggested?
I started this whole thing out poorly. I want to do conditional compiles
and my concern is the scope on the #define.
It is project wide. If you look in the Vs 2005 Project/<yourproject> Properties
menu and click the Build tab, you will see two check boxes for TRACE and DEBUG
settings. Checking these two checkboxes (the default) defines the two
throughout your project.
If you are developing on one machine and deploying to others you can use this
mechanism to change settings such as connection strings as the pseudo code below
shows.
#if DEBUG
Get the local machine connection string from the config file.
#else
Get the connection string of the remote server from the config file
#endif
In fact VS 2005 and VS 2003 will dim the text as appropriate to show you the one
the build will use.
When you set the configuration of the build to Release Debug and Trace will no
longer be defined and the release connection will be the one your application
will get from the config file.
Otis Mukinfus
http://www.arltex.com http://www.tomchilders.com