Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Visibility of defined constants
Message
From
13/12/2006 14:34:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
13/12/2006 14:11:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01177331
Message ID:
01177351
Views:
12
>I have an application that is launched with STARTUP.prg.
>STARTUP.prg contains a line #INCLUDE constants.h.
>constants.h contains a line #DEFINE CRLF chr(13) + chr(10)
>
>My understanding is that the constants thus defined should be available throughout the application.
>
>The application is running in _screen with a custom menu. The menu calls a routine contained in a .prg program file. References to CRLF within the program file result in an error that says the constant CRLF is undefined. Apparently the visibility chain is broken when control passes through a menu. Why would this be so? Is there a generally accepted way to overcome this limitation?
>
>Thanks

In addition to the other respondes you got:

You can create a bunch of #include files for different purposes, and one main #include file that #includes the others. Then, specify the main #include file in all your PRGs, forms and classes.

Example:
* Main.h
#include OfficeConstants.h
#include FoxPro.h
#include UserMessages.h
...

* In a PRG
#include main.h

* In a form: Form | Include file | (search for main.h)

* In a class: Class | Include file | (search for main.h)
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform