Naufuge Posted December 16, 2005 Share 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 Link to comment Share on other sites More sharing options...
erebus Posted December 16, 2005 Share 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. Link to comment Share on other sites More sharing options...
Naufuge Posted December 16, 2005 Author Share Posted December 16, 2005 Ok Thanks (Darn...) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 16, 2005 Moderators Share 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. Link to comment Share on other sites More sharing options...
erebus Posted December 16, 2005 Share Posted December 16, 2005 (Darn...)Use your head; there is _always_ a different approach to do what you want to do. Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted December 16, 2005 Share 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()) Link to comment Share on other sites More sharing options...
LxP Posted December 16, 2005 Share 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 Link to comment Share on other sites More sharing options...
erebus Posted December 16, 2005 Share 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. Link to comment Share on other sites More sharing options...
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