Sign in to follow this  
Followers 0
trids

Confusion over #include

2 posts in this topic

At the moment, the help file says this about #include:

Includes a file in current script.

I've noticed that there are quite a few misunderstandings about the way that this statement/directive works .. which might be avoided by altering the help file to say:

Includes a separate AutoIt source-file in the current script.

Just an idea - HTH

:lmao:

Share this post


Link to post
Share on other sites



I know that this might sound stupid... but if the description would be changed, then it would state something wrong.

#include includes every file. It doesn't care if it's a binary file, a textfile or an autoitscript.

Just look at this example (I didn't test it but my logic says that it should work):

Create a file named message.txt containing the following line:

This is a simple textfile containing a message to display_
Then create an AutoIt script:
MsgBox(0, 'Testmessage', "_
#include "message.txt"
")
Try to run the script and think about what #include includes in this case...

I think it would be better to add a remark about this with the hope that the people that don't turn on their brain before starting to script at least look at the helpfile.

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