Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to assign code to method in runtime?
Message
From
02/11/2001 07:08:27
 
 
To
01/11/2001 08:40:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00576077
Message ID:
00576619
Views:
27
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform