Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add method programatically
Message
From
12/08/2001 10:56:13
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00488347
Message ID:
00542752
Views:
23
>Hi, first, sorry for my english
>
>I'm working on methods, and I found this.
>
>If I use addproperty and then writemethod works!!!!!!!
>
>Example
>
>Close all windows, open command window and type this
>
>create class test of c:\test.vcx as custom
>_screen.forms(1).test.addproperty('mymethod')
>_screen.forms(1).test.writemethod('mymethod','* Comment')
>
>close the test window and reopen, the method is created
>
>I will use in a builder !!!
>
>VFP6 SP5

This is incredible - it really works! Not exactly each time, and it does require a save to get there, but it really works.

Man, I was trying to solve this one for four years, and this problem was actually the thing which brought me to UT - I came here looking for a solution for this problem.

The syntax may differ for a builder - I used this:
create class test of temp as form
=aselobj(aa,1)
aa[1].addproperty('newmethod')
aa[1].writemethod('newmethod', '* add code here')
And then it takes closing the editing window to get the property to become a method, but that's it.

This is a magnificent trick, and you're my software hero of the month :)

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