|
-
February 28th, 2000, 06:30 AM
#1
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
-
February 28th, 2000, 06:45 AM
#2
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...
-
February 28th, 2000, 06:51 AM
#3
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
-
February 28th, 2000, 08:38 AM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|