Jump to content

Recommended Posts

Posted

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)

Posted

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>
Posted

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

Posted

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_path

then

"New Script.au3"

Run ($my_path & "\some_app.exe") <- produces variable used without being declared error.

Thanks in advance,

niche99

Posted

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_path

then

"New Script.au3"

Run ($my_path & "\some_app.exe") <- produces variable used without being declared error.

Thanks in advance,

niche99

should be

Global $my_path = "some path"

Posted

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

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
×
×
  • Create New...