Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create Single COMMON class that exists in 10 classes
Message
From
17/02/2009 11:08:11
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Create Single COMMON class that exists in 10 classes
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Miscellaneous
Thread ID:
01382376
Message ID:
01382376
Views:
218
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
Next
Reply
Map
View

Click here to load this message in the networking platform