Azzera filtri
Azzera filtri

How to assign value to a constant or static class property

5 visualizzazioni (ultimi 30 giorni)
I wrote a test code to set a Static property (Constant, as recommended) in MyClass, as TestStatic. In TestStatic I call a static method in MyClass, setA(), to change the value of one of the constant properties. When I stop then pass over the line
MyClass.m_a = aNewA;
I can see that the variable changed value. But after I step out from the function setA(), the value returned to the default.
May I ask what I did run and what should be the fix?
In the test code, the program should start from TestStatic.
Thanks.

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by