Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question about data-objects
Message
De
04/02/2003 06:10:48
 
 
À
04/02/2003 06:00:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00748775
Message ID:
00748787
Vues:
18
Jose

Thanks, but I would ideally like to avoid using a Public variable to obtain the data-object, I need to try and keep everything tightly sealed.

In an ideal world, I would like to be able to access a data-object from, say, the command window without having to first setup any references/variables to aid its use, and have it set itself up without relying on outside occurrances.

Thanks
Kev

>You can do.
>
>
>
>*-- Main.Prg
>
>PUBLIC oApp
>oApp = CREATEOBJECT("cAppMain")
>
>oApp.ADDOBJECT("oMainAppDataObject", "MainAppDataObject")
>
>
>*-- Init your Bussines Object base class
>
>IF TYPE('oApp.oMainAppDataObject') = 'O' AND NOT ISNULL(oApp.oMainAppDataObject)
>  THIS.ADDPROPERTY("oLocalAppDataObject",oApp.oMainAppDataObject)
>ELSE
>  THIS.ADDPROPERTY("oLocalAppDataObject")
>  THIS.oLocalAppDataObject = CREATEOBJECT("MainAppDataObject")
>ENDIF
>
>
>*-- Destroy your Bussines Object base class
>
>THIS.oLocalAppDataObject = .NULL.
>
>
>
>HTH
>
>
>José Luis.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform