Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding methods
Message
De
15/12/1998 09:42:08
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00167364
Message ID:
00167652
Vues:
24
OK, Thom ---

Why not make the PRG one big DEFINE CLASS and ensure you have a PROC..ENDPROC for every procedure? Sounds to me the easiest way is to run this class def at app startup and then CREATEOBJECT to create the object with all of the methods intact.

>Sure, thanks fort the reply John,
>
>I have a .prg file that contains hundreds of procedures that are defined by job function, and I wanted to break them into classes based on the job function, add the procedures as methods, and then go in and make modifications to those methods as needed. I started to do this manually, but it became so tedious that I wanted to try and atomate the process. There may be a better way and I am very open to any suggestions.
>
>
>>Hi Thom ---
>>
>>Answers: No and No. You can't move a class DEFINEd with DEFINE CLASS to a VCX and you can't add methods programatically (although you can WriteMethod to previously defined methods)
>>
>>You *might* want to experiment with adding PROC..ENDPROC method code to the Methods column in the VCX and then recompiling the VCX but that's a bit on the dangerous side (you could corrupt the VCX).
>>
>>Perhaps if you explained why you have this need there may be alternative architectures to address it.
>>
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform