Admin Admin
Tổng số bài gửi : 34 Join date : 03/07/2010
| Tiêu đề: #include-once Sat Jul 10, 2010 7:24 pm | |
| công dụng: Quy định rằng các tập tin hiện nay chỉ có thể được bao gồm một lần. Nhận xét: nếu bạn có nhiều thư viện và trong mỗi thư viên có hàm giống nhau thì từ khóa #include-one là cần thiết ở đầu để bỏ qua nạp chồng hàm trùng tên Ví dụ: - Code:
-
;;; LIBRARY.AU3 ;;; #include-once
Func myFunc() MsgBox(0,"", "Hello from library.au3") EndFunc
;;; SCRIPT.AU3 ;;; #include "Library.au3" #include "Library.au3" ;throws an error if #include-once was not used
MsgBox(0, "Example", "This is from 'script.au3' file") myFunc() Exit
; Running script.au3 will output the two message boxes: ; one saying "This is from 'script.au3' file" ; and another saying "Hello from library.au3"
| |
|