Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I Refer to a Custom Object Before its INIT is Finish
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00173320
Message ID:
00173329
Views:
22
Michael,

By the time the Init() of an object fires it does exist and all of it's methods and properties are available to other objects. The problem is the memvar that holds the reference to this object has not yet been assigned. Does the other object need one of those methods to instantiate itself? If so you can pass THIS to the other object's Init method:

* oLib.Init()

public oOtherObject
oOtherObject = createobject( "Other", this )

There's a lot of other issues of object coupling here that you need to think about before committing too far.

>I have a Custom Object containing library functions that I use as a common routine for all my applications. During its INIT routine, I want to load another Custom Object, that I can later refer to as a separate object. This second object requires routines contained in the calling (first) library.
>
>However, I cannot refer to the library ("oLib") as an object, because the object variable is not yet created. Is there another way to refer to the library object, or do I need to create the second object outside of the library?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform