Object Name, how do I get it within class?
Hi,
I wonder if anyone can help, I have a class called for example MyClass. When my main module creates an instance of this class, i.e.
Dim Test as MyClass
set Test = new MyClass
What I need to find out within the class itself is the name of the new object I have created, in this case Test. The reason for this is that I am trying to create another object(different class) within this class. Any help would be apprciated.
Many Thanks
Ian
Re: Object Name, how do I get it within class?
You'll have to have a property such as "VariableName" which you explicityly set:
Dim Test as MyClass
set Test = new MyClass
Test.VariableName = "Test"
However, I'm mystified as to how this is going to be useful...
Re: Object Name, how do I get it within class?
Thanks for posting so quickly! thats how I am currently working at the moment, I just wanted to reduce the amount of code needed to setup the object. The reason I want the name is so that I can create another object within my current object with the same name. sounds daft but it will reduce the amount of work needed within my project.
Thanks again
Ian
Re: Object Name, how do I get it within class?
another reason I need to do this is because I need to create another object when I initilize the first object.