#include

​在使用#include陳述式的位置,插入指定的包含檔案。

格式
#include "包含檔案名.INC "

參數

包含檔案名
請指定目前專案中啟用的包含檔案名。副檔名皆為「.inc」。包含檔案名則指定插入目前檔案的檔名。

說明
​#include用於將指定包含檔案的內容插入到使用#include陳述式的位置。

請將#define陳述式和全域變數的宣告加入包含檔案中。

​請在函式定義之外部分使用#include陳述式。

可在包含檔案中記述其它包含檔案。例如,在FILE1中可包含FILE2;在FILE2中可包含FILE3。將此稱為檔案巢狀。

參照
#define、#ifdef、#ifndef

#include範例

Include File (Defs.inc)

 #define DEBUG 1
 #define MAX_PART_COUNT 20

Program File (main.prg)

 #include "defs.inc"

Function main
    Integer i

    Integer Parts(MAX_PART_COUNT)

Fend