Jump to content

#include <$var>


Naufuge
 Share

Recommended Posts

Quoting from the helpfile:

The filename of the current script to include. Path is optional. This must be a string--it cannot be a variable.

So the answer is no, the same limitation exist with FileInstall() too.

Link to comment
Share on other sites

  • Moderators

Are you trying to include an executable? If so, use FileIntall()

Edit: Guess not on the variable... good catch erebus

Edit2: Note to self! Only answer questions when not multi-tasking!

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Because #Include is a preprocessor directive (notice the hash #), it is executed before any actual script code is processed.

Also, if the program is compiled and distributed, the #Include is replaced with the text of the file that is included (File.au3, Misc.au3, etc) and nothing else can be included 'on-the-fly'.

If you are looking for the functionality I suspect you want, maybe FileMove or FileCopy would do the trick.

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

Use your head; there is _always_ a different approach to do what you want to do. :P

Like initially #Include-ing all of the possible script pieces and then using Call() or Execute() to invoke the appropriate functionality.

Edit: Added context.

Edited by LxP
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...