Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add method programatically
Message
 
 
À
12/08/2001 10:56:13
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00488347
Message ID:
00542825
Vues:
16
>>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 :)

Great tip, thanks for sharing!
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform