CodePudding user response:
Can use the class variables, similar to global variables:Type
TTestClass=class
Private
The class var Count: integer;
//...
The end;
Then increase the count in the constructor and destructor count reduction, add an attribute or read class attribute,