>Hi.
>I'm using VFP9 SP2.
>I have some constants that I tried to declare
>using #DEFINE. These constants must be used
>throughout my application (forms and procedures).
>The problem with #DEFINE is that the constants are
>only visible within the program that created them.
>How to make some constants, lets say, "PUBLIC"?
>Thanks!
"PUBLIC" as such wouldn't be the best solution, if it existed, since the existence of those constants wouldn't be clear in the application. At the same time, having to code the entire group of constants individually is somewhat counterproductive, too.
I'm a big believer in using #INCLUDE files that hold logically grouped #DEFINE constants. This especially goes when one has a set of constants that accompany a given class library - one would include someclass.vcx and someclass.h at the same time in the project and be sure to put an "#INCLUDE someclass.h" statement at the beginning of any module that used someclass.vcx. And foxpro.h shows up in almost every module I write.
Hope that helps,
David