Sign in to follow this  
Followers 0
Celeri

Something about #include ...

6 posts in this topic

The helpfile for "#include" in the documentation seems unclear:

If "..." is used, the filename is taken to be relative to the current script.

If <...> is used the filename is taken to be relative to include library directory

Me being rather dumb I started wondering where the *bleep* I would put "..." or <...>

I tried #include <...\file.in.same.directory.as.script.au3>,

#include "...\file.in.same.directory.as.script.au3"

etc. etc. etc. (and obviously to no avail).

The example didn't help either. It didn't show how to use <>

and the line

#include "TIME.AU3"
should have had a comment explaining it will include a file from the same folder as the script (as opposed to importing from the folder \Include from within the AutoIt install directory).

Hopefully not everyone is as stupid as me B)

but just in case ...

Here's an example file of my own that I believe is a bit better :o

; Different ways to use #include

#include "my_example.au3"  ; Will load "my_example.au3" from the same folder as this script
#Include <Date.au3>        ; Will load <Date.au3> from AutoIt's own Include directory.
                        ; (usually "C:\Program Files\AutoIt3\Include")
#Include <GuiConstants.au3>; Will load <GuiConstants.au3> from AutoIt's own Include directory.
                        ; (usually "C:\Program Files\AutoIt3\Include")

$a = _MyFunc(); Calls up _MyFunc, a function that is found in "my_example.au3"
$b = _Now(); Calls up _Now, a function found in <Date.au3>
$c = $GUI_CHECKED; Gets value for $GUI_CHECKED, given by <GuiConstants.au3>

I am endeavoring, ma'am, to construct a mnemonic circuit using stone knives and bearskins.SpockMy UDFs:Deleted - they were old and I'm lazy ... :)My utilities:Comment stripperPolicy lister 1.07AutoIT Speed Tester (new!)

Share this post


Link to post
Share on other sites



IIRC, the double quotes first check the @ScriptDir, then defaults to the AutoIt Install Dir\Include


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

should have had a comment explaining it will include a file from the same folder as the script (as opposed to importing from the folder \Include from within the AutoIt install directory).

Relative to the script is addressing in the same directory as the script, but can be relatively addressed from that directory. Your mention of same folder does not interpret as relative but possibly absolute.

Load does not specifically mean to include another au3 script file.

I cannot see the use of importing in the helpfile for #include?

As you are not be to the point with your example with correct words, I would consider it to cause more confusion to the concept. If someone does not understand the concept as precisely written, then that person should ask for help.

Share this post


Link to post
Share on other sites

As you are not be to the point with your example with correct words, I would consider it to cause more confusion to the concept. If someone does not understand the concept as precisely written, then that person should ask for help.

Well my point was not to impose my point of view on you or any other.

It was only to point out that the current example is less than perfect.

Next time I guess I'll keep my examples to myself B)


I am endeavoring, ma'am, to construct a mnemonic circuit using stone knives and bearskins.SpockMy UDFs:Deleted - they were old and I'm lazy ... :)My utilities:Comment stripperPolicy lister 1.07AutoIT Speed Tester (new!)

Share this post


Link to post
Share on other sites

Next time I guess I'll keep my examples to myself B)

Please, just ask for help if needed. If something seems unusual to your understanding then ask. I know that you just just mean well for everyone but overall reasonable expression needs to be exerted for everyone in the helpfile. AutoIt is not simple to learn for anyone (what is?) but once learnt you can blossom from it.

I have seen some of your latest works, keep it going. :o

Share this post


Link to post
Share on other sites

Please, just ask for help if needed. If something seems unusual to your understanding then ask. I know that you just just mean well for everyone but overall reasonable expression needs to be exerted for everyone in the helpfile. AutoIt is not simple to learn for anyone (what is?) but once learnt you can blossom from it.

I have seen some of your latest works, keep it going. :o

Thanks MHZ,

Please forget that last post B)


I am endeavoring, ma'am, to construct a mnemonic circuit using stone knives and bearskins.SpockMy UDFs:Deleted - they were old and I'm lazy ... :)My utilities:Comment stripperPolicy lister 1.07AutoIT Speed Tester (new!)

Share this post


Link to post
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
Sign in to follow this  
Followers 0