Inserts the contents of the specified source file (known as an include or header file) into the current program file at the location of the #include statement.

Syntax

#include <filename> | "<filename>" | :<sourceAlias>:filename

<filename> | "<filename>" | :<sourceAlias>:filename

The name of the file, optionally including a full, partial path or source alias, whose contents are to be inserted into the current program file. You can specify the file name within or without quotes. An include file typically has an .h file-name extension.

The preprocessor uses the following search order:

  1. Check for a specified Source Alias. Substitute a path for the source alias and check if the file exists

  2. If no source alias, or file not found, Search for the file exactly as specified in the #include statement. If a path is included, the path specified will be searched.

  3. If no path is included, the current directory will be searched.

  4. If not found, check if a file extension was specified. If not, add ".h" to the filename and search again for the file in the current folder or specified path.

  5. If not found and no path was specified and _app.useUACPaths is true:
    search for file in
    <CSIDL_LOCAL_APPDATA>\<dBASE Plus subpath>\include
    If not found search for file in:
    <CSIDL_COMMON_APPDATA>\<dBASE Plus subpath>\include

  6. If not found (or _app.useUACPaths is false) search for file in:
    _dbwinhome + "\include"

  7. If not found, search for the file in path specified via INCLUDE environment variable.
    (Note that INCLUDE must contain only one path with a trailing backslash in order for a search to be successful.)

Description

The effect of #include is as if the contents of the specified file were typed into the current program file at the location of the #include statement. The specified file is called an include file. #include is used primarily for files which have #define directives.

Identifiers are available only to the program in which they are defined. To use a single set of identifiers in multiple programs, save the #define statements in a file, then use the #include directive to define the identifiers in additional programs.

An advantage of having all the #define statements in one file is the ease of maintenance. If you need to modify any of the #define statements, you need only change the include file; the program files that use the #define statements remain unchanged. After you modify the include file, recompile your program file for the changes to take effect.

To use #include directives in WFM and REP files generated by the Form and Report designers, place the directives in the Header section of the file so that the definitions will not be erased by the designer.