Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Possible to change methods in a Class?
Message
De
11/09/1998 02:06:31
 
 
À
10/09/1998 10:13:28
Koos Veel
Gamma Research
Aruba
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00135025
Message ID:
00135385
Vues:
8
Yes, you can do this, but in a different way than you may be thinking about.

Create a property for the method you want to change (e.g. "cClick" for the "Click()" method. In the Click() method write:

IF NOT EMPTY(This.cClick)
EVAL(This.cClick)
ENDIF

Now, the trick here is to have some type of method container object which contains a library of methods For example. the oMethodManager container object could contain mymethod1, mymethod2, mymethod3, and so on.

Therefore,

This.cClick = "oApp.oMethodManager.myMethod1.Execute()"
This.Click()

would fire myMethod1 and

This.cClick = "oApp.oMethodManager.myMethod2.Execute()"
This.Click()

would fire myMethod 2 and so on.

You can even get fancier utilizing access and assign methods.

Food for thought,

-Jeff
- Jeff
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform