Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating an event on the fly
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00515711
Message ID:
00515745
Views:
11
Vlad,
That's not exactly run-time code. The class is pre-defined with the code already in the event. Now you can generate a class on the fly using FCreate(), FPuts() and FClose() but the code you add to the events is also pre-defined. When the class is compiled and instantiated, all of its methods are then static. You can't then change the event/method code unless you remove the class from memory, regenerate it in the PRG, recompile and then reinstantiate it.

To me that's not dynamic event/method manipulation but using a different class to do the job.

>Hi!
>
>You can change code in run-time. See Thread #503869 Message #503953 and next messages.
>
>>>I am creating a form with a grid and I need to set all the properties of the grid on the fly.
>>>It is easy to change the caption property:
>>>ThisForm.Grid1.column1.header1.caption = "Name"
>>>
>>>But how do I change the Click Event?
>>>
>>>Thanks
>>>Einar
>>
>>You can not change method code on the fly. Programmatically this can be done in the development environment using WriteMethod. This is not available at run time.
>>
>>What are you trying to do? Maybe there is another way of doing it?
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform