Ram 0 Posted October 11, 2007 I have written a function where I need to call another au3 file which is different directory. Simple way: I can put #include<path and test.au3> but what happens If I don;t know the path. Is there any way to use @scriptDir or something like that in #include<> so that I don't need to enter the full path or different directory path in include all the time.... I actually tried @scriptdir didn't work? Can any one help me out with this? Share this post Link to post Share on other sites
DW1 102 Posted October 11, 2007 I do believe that the #include will look in both the \autoit\includes folder as well as the @scriptdir folder.... so if test.au3 is in the @scriptdir folder then #include<"test.au3"> should work fine AutoIt3 Online Help Share this post Link to post Share on other sites
SmOke_N 211 Posted October 11, 2007 I have written a function where I need to call another au3 file which is different directory.Simple way: I can put #include<path and test.au3>but what happens If I don;t know the path. Is there any way to use @scriptDir or something like that in #include<> so that I don't need to enter the full path or different directory path in include all the time.... I actually tried @scriptdir didn't work? Can any one help me out with this?If it's in the script directory... try doing:#include "MyInclude.au3" 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. Share this post Link to post Share on other sites
Ram 0 Posted October 12, 2007 (edited) If it's in the script directory... try doing: #include "MyInclude.au3" Nope didn't work.. for e.g script directory is in c:\Scripttest\mainscript.au3 and the include script is in c:\scripttest\test\script.au3 hence as of now I have typed in the mainsscript.au3 as #include <"c:\scripttest\test\script.au3"> Now I am looking for something like #include <@scriptDir & "\test\script.au3"> because I am not sure with the main directory folder name...It can be changed any time. So I don't want to keep editing the directory everytime.. Is this possible in #include? Edited October 12, 2007 by Ram Share this post Link to post Share on other sites
Nahuel 1 Posted October 12, 2007 You can't use variables or macros as first parameter of FileInstall and you can't with #include either.filename The filename of the current script to include. Path is optional. This must be a string--it cannot be a variable.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 (usually C:\Program Files\AutoIt3\Include). The include library contains many pre-written user-functions for you to use! Share this post Link to post Share on other sites
SmOke_N 211 Posted October 12, 2007 (edited) You can't use variables or macros as first parameter of FileInstall and you can't with #include either. (is this a "In your face" moment ) #include ".\test\testing.au3" Edit: In all fairness, he did say "Variable" or "Macro" which is correct. Edited October 12, 2007 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. Share this post Link to post Share on other sites
BrettF 28 Posted October 12, 2007 #include <"c:\scripttest\test\script.au3"> Should that not be this? #include "c:\scripttest\test\script.au3" Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Share this post Link to post Share on other sites
Nahuel 1 Posted October 12, 2007 (is this a "In your face" moment )haha, no no.. I'm only allowed to be rude to people once a day. Besides, I took that from the help file Share this post Link to post Share on other sites