Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why must we use SET CLASSLIB????
Message
De
05/06/2002 20:02:41
 
 
À
05/06/2002 17:44:03
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00664748
Message ID:
00665216
Vues:
15
>Hi Fred
>
>So if I make a little PRG with a DEFINE CLASS command in it and I include that PRG in my project, will the class be available for subclassing, or must I DO .PRG first?
>

Hi Mike,

Any of your DEFINE CLASS classes would be available if you do a SET PROCEDURE TO YourClasses.PRG, but that's only necessary if you're not already using the .PRG involved. DEFINE CLASS classes can exist at the end of any .PRG that you are currently using, or is in the normal VFP execution chain. The only caveat there is that no executable code can exist after the DEFINE CLASS, only class definitions.

You main .PRG is a good place for these, and then you would not require a SET PROCEDURE TO. But as has been noted, the ability to change the hierarchy of class definitions ia very powerful tool and should not be overlooked.


>>>Hi Matt
>>>
>>>A better question might be, why do we not have an alternative to classlibs?
>>>
>>>If I built a classlib with 3 classes, I cannot share just one class with you. I have to send you all three. If the 2 classes you didn't need were based on other classes, you'd end up with a ton of extra stuff.
>>>
>>>This is not unlike the SET PROCEDURE to huge.prg. If huge.prg has tons of procedures in it, I can't easily share one of them with you, without cutting and pasting.
>>>
>>>We've always had the option of creating individual .prgs with one procedure/function in each vs the lots of procedures/functions per prg. If I create little prgs for each function, I don't have to SET PROCEDURE to use them in an APP or EXE or anytime.
>>
>>So use DEFINE CLASS for all of your classes, and you can have it the same way.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform