Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy Method Utility?
Message
De
30/01/2017 11:13:35
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
30/01/2017 10:56:30
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01647168
Message ID:
01647170
Vues:
99
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform