Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy Method Utility?
Message
From
30/01/2017 12:37:14
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
 
 
To
30/01/2017 11:13:35
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01647168
Message ID:
01647174
Views:
54
Thanks. That was very helpful, and I was able to cobble together a utility for it. The only thing I am missing is the method description. There is a parameter in WriteMethod() to include the description, but I can't find how to get it from the original class/method. Is there a function for that?

>>Does anyone know of an existing utility that will copy a method from one class to another? I am splitting up a large class with many methods into multiple classes. I figured something like this would be in Thor/PEM Editor, but I could not find it.
>
>The quick and dirty way is to create a copy and then delete the stuff you don't need. Or you can edit the source class, create a reference using aselobj() and then oRef.SaveAsClass(oref.ClassLibrary, "newName") (assuming it will go into the same classlib), or create a new class, get a reference to it the same way, and then
>
>oRefToNew.writemethod("methodname", oRef.GetPem("methodname"), .t.)
>
>(the third parameter is needed if you're adding a custom method)
>
>In the case of .saveAsClass() and a new/different classlib, make sure that you use a path in the filename or else it may create it in the current folder.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform