Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best approach about #DEFINE constants
Message
From
14/05/2008 14:56:41
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01316940
Message ID:
01317113
Views:
17
>>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!
>
>You may have one public global object (or _screen) and have these constants to be its properties.
>
>Or you would have to include this include file in every form / program where you want to use them.
>
>I see no other better way in VFP.

Actually, no. You would learn more by accepting that public variables are not recommended and trying to get away from them completely. Properties on the public object that are also public are no better than public variables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform