Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create Single COMMON class that exists in 10 classes
Message
 
 
À
17/02/2009 11:08:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Divers
Thread ID:
01382376
Message ID:
01382379
Vues:
75
One way is to add your class to the _screen, e.g.

_screen.AddObject('common',createobject('common'))

>Hi all
>
>- I have to create a single class COMMON
>- Single one instance of this class should be exist in 10 other classes
>
>Example
>
>
>
>oCommon = createobject("common") && This is declared somewhere in my application
>
>** class creation
>oClass1 = createobject("class_1")
>oClass2 = createobject("class_2")
>oClass3 = createobject("class_3")
>oClass4 = createobject("class_4")
>
>** I want to Add oCommon to oClass1-6 where if I write something like
>oClass1.oCommon.Prop_1 = 10 && Assign a value to a property in oClass1 will affect all the other classes
>
>? oClass2.oCommon.Prop_1 && <-- Gives 10
>? oClass3.oCommon.Prop_1 && <-- Gives 10
>? oClass4.oCommon.Prop_1 && <-- Gives 10
>
>
>
>What is the best way of doing this especially if oCommon = createobject("common") will be executed only once?
>
>TIA
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform