Jump to content

#include


Guest adreher
 Share

Recommended Posts

Guest adreher

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

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 :ph34r:

Link to comment
Share on other sites

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

The sequence of events:

  • Functions.au3 is written
  • Script1.au3 is written, #include'ing, Functions.au3
  • Script2.au3 is written, #include'ing, Functions.au3
  • Script1.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.au3
My 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 Nuttall
Nuttall 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...