Hi,
I tried to create what is know as a "class variable". As far as I understand the only analogy to class variables would be the "class parameters".
I tried to use a class parameter but I cannot change its value at runtime.
Parameter STATUSES = {{}};
Property repr As %String;
Method %OnNew(repr) As %Status
{
w ##class(Test...).#STATUSES
w ..#STATUSES
...
}
When I get ..#STATUSES
, it is a string like "5@%Library.DynamicObject". This is a string, not a pointer to an object.
I tried to define STATUSES as Parameter STATUSES As CONFIGVALUE = {{}};
and change the value with
d $system.OBJ.UpdateConfigParam("Test","STATUSES",{"a":10})
but it has no effect.
I need a class variable that is updated from %OnNew as a singleton . I try to make a class variable dictionary that keeps the instances defined so far.
My questions are, how to create a singleton and how to define a class variable ?
Greetings,