Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class Hierarchy Question
Message
 
À
24/07/2005 04:31:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01035408
Message ID:
01035572
Vues:
10
Gregory,

Thanks for the advice, but this does not work as expected. Below is a sample.

"theFirst" implements "theSecond" which implements "theThird" (I know, I know, I over did it!). theThird's "myVal" property is passed up the line.
DEFINE CLASS theFirst as Custom
oSecond=NEWOBJECT("theSecond")
myVal=this.oSecond.myVal
ENDDEFINE

DEFINE CLASS theSecond as Custom
oThird=NEWOBJECT("theThird")
myVal=this.oThird.myVal
ENDDEFINE

DEFINE CLASS theThird as Custom
myVal="1234"
ENDDEFINE
So I instantiate theFirst and access members:
oFirst=NEWOBJECT("theFirst","theClass.prg")
? oFirst.myVal                             (prints "1234")
? TYPE("oFirst.oSecond")                   (prints "O")
? TYPE("oFirst.oSecond.oThird")            (prints "U")
oSecondAndAHalf=oFirst.oSecond
? oSecondAndAHalf.myVal                    (prints "1234")
? TYPE("oSecondAndAHalf.oThird")           (prints "O")
? TYPE("oSecondAndAHalf.oThird.myVal")     (prints "U")
...you get the idea.

If I try:
? oFirst.oSecond.myVal
I get an "Unknown member OSECOND" error.

So what the hell am I missing here?

Thanks!
John MR Fitzgerald
Order Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform