关键字参考


#include-once

指定当前文件只能被包含一次.

#include-once

参数

None.

注意/说明

如果您包含的同一个文件中包含一个用户自定义函数超过一次, 您将得到 "Duplicate function"(重复函数) 错误. 在编写包含文件时最好在首行添加一句 #include-once 指令以避免该文件被重复包含.

相关

#include

示例/演示



;;; SCRIPT.AU3 ;;;
#include "include-library.au3"  ;throws an error if #include-once was not used

MsgBox(4096, "Example", "This is from 'script.au3' file")
myFunc()

; Running script.au3 will output the two message boxes:
; one saying "This is from 'script.au3' file"
; and another saying "Hello from library.au3"