Naufuge Posted December 16, 2005 Posted December 16, 2005 Its it possible to include a file thats location is stored in a var? Like $File_OpenDialog = FileOpenDialog("Open File...",@ScriptDir,"Application (*.exe)",1+2+8+16) #include <$File_OpenDialog> Thanks Brian
erebus Posted December 16, 2005 Posted December 16, 2005 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.
Moderators SmOke_N Posted December 16, 2005 Moderators Posted December 16, 2005 (edited) 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 December 16, 2005 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.
erebus Posted December 16, 2005 Posted December 16, 2005 (Darn...)Use your head; there is _always_ a different approach to do what you want to do.
MSLx Fanboy Posted December 16, 2005 Posted December 16, 2005 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())
LxP Posted December 16, 2005 Posted December 16, 2005 (edited) Use your head; there is _always_ a different approach to do what you want to do. 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 December 16, 2005 by LxP
erebus Posted December 16, 2005 Posted December 16, 2005 I think that he wants to use #include's filename dynamically. A good idea is to #include everything of course as LxP said.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now