Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange behavior
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Strange behavior
Divers
Thread ID:
00799544
Message ID:
00799544
Vues:
54
Hi!

Take a look at this:
Define Class MyClass As Session
    Emp = CreateObject("MyOtherClass")
EndDefine
Define Class MyOtherClass As Session
    Name = "Test!"
EndDefine
So...:
MyObj = CreateObject("MyClass")
? MyObj.Emp.Name && I got an error here...
Open the DEBUG WINDOW, and type:
MyObj

So, open the "Emp" node and you can see the Name property and its value.

But, if you type (in DEBUG WINDOW):
MyObj.Emp -> "Expression could not be evaluated"

Why it?

To correct this problem, I just change my code:
Define Class MyClass As Session
    Emp = Null
    Function Init
        This.Emp = CreateObject("MyOtherClass")
    EndFunction
EndDefine
Define Class MyOtherClass As Session
    Name = "Test!"
EndDefine
[]s!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rodolfo Duarte
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform