Borrar filtros
Borrar filtros

How to assign value to a constant or static class property

5 visualizaciones (últimos 30 días)
Ming Chao
Ming Chao el 5 de Nov. de 2021
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.

Respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by