- Home /
#Warning with variables
Using C#, can you add variables or constants to a #warning message?
Answer by Baste · May 06, 2015 at 03:13 PM
the #warning tag is a preprocessor directive. This means that it is processed by the compiler before the main code. It's only around when compiling, a time at which any variable definitely won't have a value yet, so it would not make any sense for it to be able to interact with variables.
I guess it could technically interact with constants, but again, those will have been read after the preprocessor directives has been handled. So the answer is, again, no. Although since a constant is... constant, you could just write it out in the #warning
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Making a bubble level (not a game but work tool) 1 Answer
NullReferenceException: Object reference not set to an instance of an object 0 Answers
An OS design issue: File types associated with their appropriate programs 1 Answer