Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Classes - Best Practices?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00763778
Message ID:
00765447
Vues:
14
>><snip>
>>>So I have another question...
>>>Two things that I really like about VB are constants and enumerations. I >like being able to scope my constants as public or local. VFP doesn't >provide that exactly, though with #DEFINE...#UNDEFINE you can approximate >that behavior. Enumerations appear to be out of the question as well.
>>>
>>
>>Enumerations are out of the question. However, I am surprised to hear you >say that #DEFINE "can approximate" the behavior. What seems different to >you?
>
>Well, nothing actually except that you have to UNDEFINE them at the end of a method/procedure if you want them to be local in scope - unless I'm misunderstanding something. In VB, constants created within a method/function/sub are local unless declared as public. Perhaps "approximate" was a bad choice of words.


Actually, I do see your point now. It is an extra step. Point granted.... :)


>
>>>Is there a way in a visual class to use #DEFINE to create a constant that >is available to any method in the class?
>>
>>Include the #DEFINE in an include file, and then include the file using the >Class | Include File menu option.
>
>Okay, that hadn't occurred to me. That should handle the class-level constants that I need. But is the scope of those constants such that they are only available to the class or do they become available to all the classes within a library?

Class-specific, not class-library level.
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform