Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NewObject or CreateObject or AddObject
Message
From
28/08/2007 11:20:33
 
 
To
28/08/2007 10:41:35
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01250745
Message ID:
01250917
Views:
20
I've gotten the impression from others that it is important to create some objects while in the INIT of other objects to (supposedly) contain them and maintain a parent/child relationship. I have tried this, and though the second object appears as an element of the first object, there is no value in the .Parent property.

As I said before, it does not matter where you create an object, but how. This is the fundamental difference between aggregation (where there is no parent/child releationship and one object merely holds a reference to another object) and composition ( where the is a parent/child relationship between the objects ).

So, oRef is created as an object of THIS? THIS is another object, but oRef has no .Parent? How to get a value of a property of THIS from a procedure contained in oRef?

No - oRef has an independent existence and "This" holds a reference to it. There is no parent/child relationship here.

You can pass in parameters to oRef's Init() and let oRef process them. Or you can set some of oRef's properties after instantiating it.

I was wondering about that. Currently when I quit my program, I still have to Remove reference from memory before I can edit my PRG.

In the destroy of the object that is holding the reference to oRef, RELEASE it and for good measure, set it to .NULL.
Previous
Reply
Map
View

Click here to load this message in the networking platform