niche99 Posted October 27, 2005 Share Posted October 27, 2005 Hi, Coming from a C++ background, I want to create a "My Includes.au3". This will have the lines - include-once #include <file.au3> #include "My Paths.au3" ... etc I then want my default template for a new script to read (not a problem to do) #include "My Includes.au3" So when I have - New Script.au3 #include "My Includes.au3" ... _FileWriteLog($AutoIt_Script_Log, @ScriptName & ": Failed: Looking for " & $LookFor & " timed out.") <- This line causes an unknown function error message to be displayed. Why, are includes not nested? Thanks in advance, niche99 (using latest version of autoit) Link to comment Share on other sites More sharing options...
poisonkiller Posted October 27, 2005 Share Posted October 27, 2005 Try: #include-once #include <file.au3> #include <My Paths.au3> ;this file must be in Includes directory in Autoit dir. and includeing it to you script: #include <My Includes.au3> Link to comment Share on other sites More sharing options...
niche99 Posted October 27, 2005 Author Share Posted October 27, 2005 Try:#include-once #include <file.au3> #include <My Paths.au3> ;this file must be in Includes directory in Autoit dir.and includeing it to you script:#include <My Includes.au3>Thanks for the fast reply. I would like to have "My Includes.au3" in another location. Is this possible?niche99 Link to comment Share on other sites More sharing options...
poisonkiller Posted October 27, 2005 Share Posted October 27, 2005 Includes from my desktop: #include <C:\WINDOWS\Desktop\My Includes.au3> Link to comment Share on other sites More sharing options...
niche99 Posted October 27, 2005 Author Share Posted October 27, 2005 Includes from my desktop:#include <C:\WINDOWS\Desktop\My Includes.au3>Thanks for the fast reply. I now have another problem. Variables declared in "My Includes.au3" are not in scope in "New Script.au3".eg."My Includes.au3"Global $my_paththen"New Script.au3"Run ($my_path & "\some_app.exe") <- produces variable used without being declared error.Thanks in advance,niche99 Link to comment Share on other sites More sharing options...
niche99 Posted October 27, 2005 Author Share Posted October 27, 2005 Thanks for the fast reply. I now have another problem. Variables declared in "My Includes.au3" are not in scope in "New Script.au3".eg."My Includes.au3"Global $my_paththen"New Script.au3"Run ($my_path & "\some_app.exe") <- produces variable used without being declared error.Thanks in advance,niche99should be Global $my_path = "some path" Link to comment Share on other sites More sharing options...
niche99 Posted October 27, 2005 Author Share Posted October 27, 2005 should be Global $my_path = "some path"Sorry, problem fixed, a typo. Eyesight going after 26 hrs straight coding. Link to comment Share on other sites More sharing options...
poisonkiller Posted October 27, 2005 Share Posted October 27, 2005 plz give all of code! and use [ code ] and [ /code ].Example: [ code ](Without spaces);You script ;your script ;your script end[ /code ](without spaces) so it should be: ;your script ;your script ;your script end Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now