Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
In what class am I?
Message
De
09/11/2001 10:57:57
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
09/11/2001 06:23:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00578989
Message ID:
00579674
Vues:
33
>>>The debugger tells me that I am in MyLibrary:MyFormSCX.MyMethod. Actually, I am in MyMethod in an inherited class. The inheritance in the framework can go through several levels. The class is in the indicated library, but I may have several classes in MyLibrary.
>>>
>>>So, how do I find out in what class am I really? program() only shows MyForm.MyMethod.
>>
>>I habitually keep This in the watch window. The problem is solved, but there's another problem: where is the code I am looking at, if it's inherited from (grand*n)parent class code? In VFP 7 PEM window it clearly says where ("Inherited from ...") and I only wish it could be copied from there and pasted into the command window (as in "modify class ... of ... method ..."), but how do I know this in the debugger? Is there a way for this?
>
>Adapting other answers I got in this thread, I wrote "This.Class" in the watch window. When inherited code is run with DoDefault() or scope resolution, this tells me what class is currently running. Is this what you want, or did I misunderstand?

It's the class of the current object, but the code you see in the trace window is not necessarily in that class. It may come from the parent class, grandparent class etc. VFP knows where it comes from, because it unmistakenly takes you there when you choose Debug/Fix, or shows it in the PEM window while editing a class. I may like to know that right away while debugging.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform