Hi John,
>Is there a way in a visual class to use #DEFINE to create a constant that is available to any method in the class? For that matter, can you create a non-public variable that is available to any method in the class? It doesn't appear that it's possible from what I've tried so far. A constant declared in the Init event does not appear to be available to a user-defined method. And variables only seem to be available if created as PUBLICs.
>
>With the .PRG approach, I can create constants at the beginning of a class definition and #UNDEFINE them afterwards and have, in effect, a class level constant. I don't think I can do the same with variables as any variables declared at the class level become properties.
>
>Any thoughts?
What you can do is create a .H file which is merely a text file which contains a whole bunch of #DEFINE statements. Then, while on the Class Designer, go to the Class menu and choose Include... you may now include the .H file you did and voila! those constants are available to all the methods in that class!
HTH,
Dennis
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement