Keyword Reference


#include-once

Specifies that the current file may only be included once.

#include-once

Parameters

None.

Remarks

If you include the same file containing a user-function more than once, you will get a "Duplicate function" error. When writing an include file that may be used in this way, make sure that the top line contains #include-once to prevent that file from being included more than once.

Related

#include

Example



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

MsgBox(0, "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"