Compiler constants

  • Thread starter Thread starter martin
  • Start date Start date
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
 
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.
 
Back
Top