Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Code Programmatically
Message
From
18/10/1998 19:16:16
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
18/10/1998 01:03:07
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00147160
Message ID:
00147981
Views:
23
>>>Any ideas on how to add method code
>>>programmatically?
>>
>>If you mean adding it at design time (for conversion purposes, or builders/wizards), it depends on what are you adding. If the method which you fill with code already exists in the class definition, just stuff the new code into a string and call the WriteMethod(lcSourceString) - which you can do from a builder, or by having an instance of the object in memory.
>>
>>If it's a method which never existed, i.e. a custom method, you will need to add a reference to it into the Reserved3 memo of the appropriate record in the vcx/scx file, reinstantiate the object, and then you may proceed as in the first case.
>
>You won't be able to do this in a standalone exe, even if your vcxs are excluded from the project, because the VFP compiler is not distributable, and the code that actually runs from a vcx must be compiled.

Yes, this is something even CodeBlck can't cope up with. You need hooks or any other clever way out - like building a form entirely in memory, and calling the method snippets via hooks to CodeBlck, and that's altogether a kludge which is not even sure to work.

The question in the title of this thread was exactly the thing which first brought me to UT, so I felt urged to write what I have found out on the subject in these 18 months. Aside from unavailability of .WriteMethod at runtime, it's also got its quirks at design time.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform