CyberwormXT Posted January 4, 2010 Share Posted January 4, 2010 Hi! I'm new here and I got a question regarding #include. Is it possible to include scripts via loop? Let's say that I got an array containing the files in a directory. Now I loop over that array and for each element (e.g. 1.au3) I want to include that element into my script (so that it will result in a #include "dirpath\1.au3"). If that's not possible, can I include a whole directory into my script? Thanks for the help, CyberwormXT Link to comment Share on other sites More sharing options...
James Posted January 4, 2010 Share Posted January 4, 2010 This is a good question! I would say so; possibly through using the Execute() function? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
CyberwormXT Posted January 4, 2010 Author Share Posted January 4, 2010 (edited) Yes I already tried that. I have two files I want to include: 1.au3 and 2.au3. Both scripts contain a simple function that will Display a Message box (e.g. "I'm #1"). After including both files via loop I try to call that function. But after trying to run the script it tells me that the function cannot be found. So either I'm doing something wrong or the scripts are not included at all. Edited January 4, 2010 by CyberwormXT Link to comment Share on other sites More sharing options...
botanic Posted January 4, 2010 Share Posted January 4, 2010 Includes are not ment to be used this way, honestly i don't think it is possible. Put all the functions in one file and include that. Link to comment Share on other sites More sharing options...
CyberwormXT Posted January 4, 2010 Author Share Posted January 4, 2010 Hmm. I see. Well, nevermind then. I'll manually include the files . Thanks anyway . 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