Includepp Statement

Top  Previous  Next

Function:

Includes preprocessor directives found in a specified file at the point of the statement.

Syntax:

 

includepp filename

Scope:

Global and HTML

See Also:

Include Statement

 


Part

Description

"filename"

Contains the filename to be parsed for preprocessor directives. The path can be a relative path to the project path, an absolute path (such as c:\myfolder\myfile.tbs) or even a UNC path (such as \\MY-SERVER\Main\myfile.tbs).

Details

Makes compiler parse the specified file and include all lines that start with "#". This is mainly intended to facilitate inclusion of preprocessor directives from library configuration files.

Examples

As an example, consider the setting descriptor file, which defines the list of settings to be maintained by the STG library. The file is supposed to provide a list of #define statements to override default #define statements of the STG library.

 

File: global.tbh (a header file)

 

includepp "settings.xtxt"

include "settings\trunk\settings.tbh"

 

       

File: settings.xtxt (setting descriptor file)

 

>>BT        E        B        1        0        255        A        0        This is a Byte setting

>>WD        E        W        1        0        65535        A        0        This is a word setting

>>ST        E        S        1        0        16        A        ^        This is a String setting

>>DD        E        D        1        0        4        A        ^        This is a dot-decimal String setting

#define STG_DESCRIPTOR_FILE "settings.xtxt"

#define STG_MAX_NUM_SETTINGS 4

#define STG_RAM_ARRAY_SIZE 0

#define STG_MAX_SETTING_NAME_LEN 2

#define STG_MAX_SETTING_VALUE_LEN 16

 

 

As a result, all #define statements from settings.xtxt will be included. Lines that do not start with "#" will be ignored.