Le Pat
05-29-2021, 08:18 AM
Hi everybody !
I'm trying to count the number of instantiations of a class.
Typically, in the context of 'Object', it speaks here of a class variable (and not an instance variable). This variable will increment by 1 each time the class is instantiated.
Example :
There is a class S1 in a class module.
On a form:
dim elem1 as S1
dim elem2 as S1
set elem1 = new S1
set elem2 = new S1
Here, I'd like to obtain the result is 2 and to get this value from the variable in the class S1.
Do you have a small example on hand?
Thank you in advance for your answers !
I'm trying to count the number of instantiations of a class.
Typically, in the context of 'Object', it speaks here of a class variable (and not an instance variable). This variable will increment by 1 each time the class is instantiated.
Example :
There is a class S1 in a class module.
On a form:
dim elem1 as S1
dim elem2 as S1
set elem1 = new S1
set elem2 = new S1
Here, I'd like to obtain the result is 2 and to get this value from the variable in the class S1.
Do you have a small example on hand?
Thank you in advance for your answers !