Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy Method Utility?
Message
From
30/01/2017 11:13:35
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
30/01/2017 10:56:30
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01647168
Message ID:
01647170
Views:
98
This message has been marked as the solution to the initial question of the thread.
>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.

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