Search the Community
Showing results for tags 'include-once'.
-
I have many scripts with dozens of UDF's that I want to put into my own Include file. I moved a UDF from one of my scripts to my own "Include file" I added the include script file to my script and the script ran OK. (#include <C:\folder\MyInclude.au3>) I thought "Wow", lets put a bunch of my UDF's into my include script and reduce my 1200 line script a whole bunch. No matter what I do, the second UDF that I moved out of my main script causes an error "Undefined function Abc2()" when I attempt to run the script. I have "include-once" at the top of the include script file. Thanks for your help
-
Function In My Include script Not seen - (Moved)
AutoitMike replied to AutoitMike's topic in AutoIt General Help and Support
Consider this example: This is MyInclude.au3 #Include-once Func Abc() Msgbox(0,'','Hello from "ABC" ') EndFunc Func Def() Msgbox(0,'','Hello from "DEF" ') EndFunc This is my main script: #include <C:\Folder\MyInclude.au3> Abc() ;Runs OK if Def() is commented out Def() ;Produces error "Undefined function" script does not run This is the structure that I see in all of the existing AutoIt "Include" scripts that am currently using. THIS particular script is not in the same location as all of the other "Includes" , that is why I have the path in the "Include" statement (Which works for ABC() ) Why does this not work?? Thanks for your help