#INCLUDE Preprocessor Directive

Example   See Also

Tells the Visual FoxPro preprocessor to treat the contents of a specified header file as if it appeared in a Visual FoxPro program.

Syntax

#INCLUDE FileName

Arguments

FileName

Specifies the name of the header file that is merged into the program during compilation.

You can include a path with the header file name. When you include a path with the header file name, Visual FoxPro searches for the header file only in the specified location.

If you do not include a path with the header file name, Visual FoxPro searches for the header file in the default Visual FoxPro directory, and then along the Visual FoxPro path. The Visual FoxPro path is specified with SET PATH.

Remarks

You can create header files containing preprocessor directives and then use #INCLUDE to merge the contents of the header file into a program when the program is compiled. The contents of the header file are inserted into the program during compilation at the point where #INCLUDE appears in the program.

Only the #DEFINE ... #UNDEF and #IF ... #ENDIF preprocessor directives are recognized in a header file. Comments and Visual FoxPro commands included in a header file are ignored.

A program can contain any number of #INCLUDE directives. These directives can appear anywhere within the program. #INCLUDE directives can also appear in header files, allowing you to nest #INCLUDE directives.

Header files typically have an .h extension, although they can have any extension. A Visual FoxPro header file, Foxpro.h, is included. It contains many of the constants described throughout this documentation.