>>Defined constants are like anything else in programming. Used correctly they can be extremely important in the areas of readability, reduction of overall application size, and performance. Used incorrectly (abused, if you ask me), they can make maintenance a nightmare.
>>
>>As far as I'm concerned, in most cases, if you're worrying about the underlying value of the constant or need to know it, it's a strong hint that it's being mis-used. So my rule of thumb in this regard is to use it in those cases where you really don't care as much about the meaning as you do what it represents. Take the MESSAGEBOX() constants, I don't particularly care about what the underlying values are, but I do care about their meaning. Simple illustration would be seeing a return shown as MB_IDYES or 6 (and I had to look it up)?:-)
>
>Hi George - Let me use Jim's PI example...does it really matter whether you use a local or a #define for the PI value? I've always used locals or properties for such things, but am wondering if it's worth moving to constants.
Bruce,
The #DEFINE will be faster.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer