Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I Refer to a Custom Object Before its INIT is Finish
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00173320
Message ID:
00173332
Vues:
27
David,

Thanks for writing. That works. By passing the first object's "THIS" to the second, I can refer to the first object before its variable is created. However, in my situation, the results are inconsistent. Perhaps this is one of those "issues" to which you referred. Therefore, I'll just file this away for future reference.

Thanks!

Michael Reynolds


>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?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform