473,405 Members | 2,349 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,405 software developers and data experts.

Compiler constants

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
Nov 18 '05 #1
1 1288
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.

"martin" <St**************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #2

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

Similar topics

3
by: Nick L. | last post by:
All, This is a general question regarding how, and if, compiler optimization techniques affect the general concept of being able to update a component of an application without requiring a...
13
by: Andrew | last post by:
I use conditional compiler constants, set through the VBA IDE in Tools, <projectname> Properties, that I refer to throughout my code to control which code is used during development, and which...
43
by: Anitha | last post by:
Hi I observed something while coding the other day: if I declare a character array as char s, and try to use it as any other character array..it works perfectly fine most of the times. It...
29
by: Daniel Rudy | last post by:
Hello, Consider the following code fragment: fileptr = fopen(param->filename, "r"); if (fileptr == NULL) { error("digest.c: digest_file: Open File ", errno); return(-2); }
1
by: Benne Smith | last post by:
I can't seem to use my normal compiler constants from inside a macro ? It's possible to define NEW constants inside the macro, but this is not what i need. Does anybody know a way to get to...
30
by: Philippe Bertrand | last post by:
Is this a bug in the C# compiler or CLR runtime? enum MyEnum { ZERO = 0, ONE = 1, TWO = 2 } class Foo { public Foo(string,object) { ... } public Foo(string,MyEnum) { ... } } Foo f = new...
0
by: Steve - DND | last post by:
I have a web project which references some assemblies from other projects I have worked on in different solutions, and am running into some quirky behavior. My web project assembly is...
19
by: David W | last post by:
float nanometers(long pm) { return pm / 1000.0f; } void f() { if(nanometers(309311L) == nanometers(309311L)) { // do something }
41
by: p_cricket_guy | last post by:
Please see this test program: 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <limits.h> 4 5 int main (void) 6 { 7 int y = -2147483648; 8 int x = INT_MIN;
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
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,...
0
isladogs
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...

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.