Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add method programatically
Message
From
26/03/2001 00:00:19
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00488347
Message ID:
00488483
Views:
11
>Hi
>
>How can I add a method at design time programatically?
>It's for a builder

No way. I'm fighting that one for four years, third version of Fox now. The only way is to add the code (including the PROCEDURE and ENDPROC lines) to the Methods memo of the .scx, add the proper line to the Reserved3 field, blank the ObjCode field, close the form (opened as a table) and compile it. Then you can reopen it. Not something you can do from a builder. Even VFP's converter from 2.6 forms doesn't build objects, it creates the .scx file as a table and does some crunching and munching with it.

For details, you can download Alejandro Sosa's converter, recently updated, from the Files section, and see how does it work there. I didn't look at it recently, but I figure it still uses this technique.

Alternate way would be to somehow instantiate the Edit property/method or New Method forms (accessible from the menu while editing form or a class), which I never succeeded.

back to same old

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

Click here to load this message in the networking platform