Guest adreher Posted July 20, 2004 Share Posted July 20, 2004 Hello, I am using the #include and #include-once command in my scripts. If I change the functions.au3 - script then I have to recompile all other scripts that include this script otherwise the changes won´t work. Is this a bug? functions.au3: ---------------- #include-once .. .. .. script1.au3: -------------- #include "c:\scripts\functions.au3" .. .. .. Thanx Andi Link to comment Share on other sites More sharing options...
jpm Posted July 20, 2004 Share Posted July 20, 2004 I was thinking that #include <...> will always refer to the current install include file whatever the script is compile or not. I don't think I am right, so you really need to recompile all refering scripts Link to comment Share on other sites More sharing options...
Administrators Jon Posted July 20, 2004 Administrators Share Posted July 20, 2004 Compiled scripts contain all the includes required to run. It wouldn't be very "standalone" if you still needed to give access to the include files! Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
pekster Posted July 20, 2004 Share Posted July 20, 2004 adreher, the best way to think about the #include directive is that it will place whatever code is in the include file at that point in your source. Just like any source, if you compile it, it will remain the same even if you change the source code. However, if you change the source of the include file and re-execute your script, it will use the updated include file since it's "pasting" the code from the now changed file. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
Nutster Posted July 20, 2004 Share Posted July 20, 2004 The sequence of events:Functions.au3 is writtenScript1.au3 is written, #include'ing, Functions.au3Script2.au3 is written, #include'ing, Functions.au3Script1.au3 is compiled to Script1.exe, with a copy of Functions.au3 included.Script2.au3 is compiled to Script2.exe, with a copy of Functions.au3 included.Functions.au3 is modified.Script1.au3 is re-compiled. The new version of Functions.au3 is included.Script2.au3 is left alone. It still contains the old version of Functions.au3My general recommendation is if Script2.au3 is working without the new Functions.au3, then just leave it. If it is improved by the updated Functions.au3, then recompile it. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... 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