Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question about data-objects
Message
From
04/02/2003 06:10:48
 
 
To
04/02/2003 06:00:13
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00748775
Message ID:
00748787
Views:
17
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform