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:37:45
 
 
À
02/01/2000 07:53:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00311323
Message ID:
00311349
Vues:
16
>Hi,
> 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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform