Compiler constants

M

martin

Hi,

I am having a little trouble defining compiler constants and picking then up
in my code.

In the configuration manger I defined the constant "Martin"

I then set the Project Configuration to "Martin" in the configuration
manager.

however the following code does not pick up the fact that my project has the
compiler constant "Martin" set

#If Martin Then

response.Write("Compiled for martin.")

#Else

Response.Write("NOT COMPILED FOR MARTIN")

#End If


Additionally when I type "#IF" the intellisense pops up three compiler
constants "DEBUG","CONFIG" and "TRACE" however niether "RELEASE" or "MARTIN"
is there, should I be seeing my compiler constant in this list??

many thanks in advance.

cheers

martin
 
A

Andy Gaskell

I think you might be confusing solution configurations with constants. You
don't need to create a new configuration to define a constant. You define
constants in the Property Pages for the project in the Custom constants
textbox. You'd enter the text Martin=1 to define the constant Martin - and
yes, Intellisense will pick this up. The reason "RELEASE" won't show up is
because RELEASE is a solution configuration, not a constant.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top