Ram Posted October 11, 2007 Share 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? Link to comment Share on other sites More sharing options...
DW1 Posted October 11, 2007 Share 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 11, 2007 Moderators Share 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. Link to comment Share on other sites More sharing options...
Ram Posted October 12, 2007 Author Share 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 Link to comment Share on other sites More sharing options...
Nahuel Posted October 12, 2007 Share 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! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 12, 2007 Moderators Share 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. Link to comment Share on other sites More sharing options...
BrettF Posted October 12, 2007 Share 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! Link to comment Share on other sites More sharing options...
Nahuel Posted October 12, 2007 Share 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 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