I have a class constant that I have set with a numeric value in the IDE at run time. I have a shared method in the class that uses the constant and at run time the value is zero. In the IDE it has a numeric value of 28.35.
I didn’t think that was possible, given that it’s a constant.
The code is part of a larger project that would be problematic for me to post, but I replicated my workflow in a test project that I have attached. The thing is, it works as I expected in this project.
It doesn’t in my real project. Did I mess this up somehow?
This is a screenshot of my actual code so you can see what I’m doing:
This is my UnitConversion class, with my shared (static) method:
without seeing the original its hard to know what you were experiencing
can say I’ve never seen such an issue
and the only naming rule you might violate is that you cant name the constant the same as a keyword - but the IDE would stop you from doing that when you try to create the constant
Just to close this off… I made some kind of mistake. I’m not sure what it was but the code I posted worked as I expected I returned home later in the day. I don’t have an explanation for this, other than I made a mistake someplace. I’ve I knew what the code was that I broke, I would’ve posted it so we’d know…