Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to call Object.Method from On Selection Bar command?
Message
De
02/01/2000 10:47:03
 
 
À
02/01/2000 10:37:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00311323
Message ID:
00311352
Vues:
28
Exactly. Point at stuff you do know exists. For example, if you have an oApp you can point menu options at oApp and let oApp mediate the calls to the active form or other widgets.

>> I have bar of menu that may need to call method from my class. How could I do so if I don know the reference of the object (myvar = createobj("myclass")), however using THIS or any other ways to reference?
>>
>
>Unfortunately, you can't - you need an object reference to use a method. You don't know what the "this" or "thisform" or "thisformset" relative reference will necessarily be at any given moment from the context of a menu or toolbar, and so blind reference to a method or the method of an object higher in the reference nest is not appropriate. If you need to have the ability to reference an objuect, you need to have a way of pointing to that object in a consistent fashion within your code. Code isn't good at guessing in what context something is meant, and we don't have a DWIM or DWIW (Do What I Mean/Do What I Want) construct available.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform