Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to place .H file?
Message
From
03/08/2009 22:29:04
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01415979
Message ID:
01416010
Views:
49
>Hi,
>
>I am confused to where to put an include (.h) file in the main program of the application. The main program of the application starts with code (no Function or Procedure declaration). Then there are some classes defined in this .PRG file that should use an include file. I think the .H (include file should be above all procedures/function but since the .PRG does not start with one, where to specify
>
>#include "MyFile.h"
>
The #include - or a #define for that matter - doesn't consider functions, etc. It is a "preprocessor directive", meaning that any replacement will be done before the compilation proper.

In the case of a PRG, just put it at the top of the file - before any executable statements. In the case of a form or class, use the command "Form | Include file" or "Class | Include file" to make the #include available for all methods. Since you can only specify ONE file here, the appropriate action seems to be to include a single main #include file, and have this one #include others (foxpro.h for constants like the ones used for MessageBox(), xl97cons.h or something for Excel constants, any other constants you want to define, which may be spread among different files).
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