Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to assign code to method in runtime?
Message
 
 
À
01/11/2001 08:40:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00576077
Message ID:
00576619
Vues:
25
Hi!

For what you need this? There are always OOP-like approaches that does not require ANY assigning of code to method/event in run-time. There is a way to do this (described below), but it have limited capabilities and does not work for ActieX/OLE objects.

set procedure to MyHooks.PRG
loMyObject = thisform.TextBox1
thisform.AddObject("oHook","MyClass")


* MyHooks.PRG:
DEFINE CLASS MyClass AS Custom
oMyObject = loMyObject
procedure oMyObject.Valid
= messagebox("Something")
endproc
ENDDEFINE


HTH.

>Hi
>how to assign code to method in runtime?
>
>Thank you
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform