Noam,
When you use constants the compiler will embed (substitute) their values
at compile time in the IL , so I presume that would be the equivalent.
I.e.:
const int THIS_VAL = 10 ;
const int MAX_THAT = 255 ;
Then, if you reference THIS_VAL or MAX_THAT in your code like so...
if( myValue >= MAX_THAT ) {}
The compiler will embed the literal value at compile time, i.e.:
if( myValue >= 255 ) {}
I think - but don't quote me - that the only tip-or-trick with this is
that you have to watch what's happening in referencing assemblies when
you make changes to the class that contains the const values.
Cheers,
Darren
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.