fade2gray Posted March 5, 2009 Posted March 5, 2009 Sorry to kick off with a noob whinge.I've been presented with an au3 script to try which has a '#include' directive.Wanting to understand how '#include' functions, I tried the following example from the help file...;;; TIME.AU3 ;;;MsgBox(0,"", "The time is " & @HOUR & ":" & @MIN & ":" & @SEC);;; SCRIPT.AU3 ;;;#include "TIME.AU3"MsgBox(0,"", "Example")#include "TIME.AU3"Exit; Running script.au3 will output three message boxes:; one with the time, one with 'Example', and another with the time.The problem is that, "C:\Program Files\AutoIt\Include" does not contain a file called "TIME.AU3"Thanks for any info.
Developers Jos Posted March 5, 2009 Developers Posted March 5, 2009 you are supposed to create both files yourself in the same directory. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
SpookMeister Posted March 5, 2009 Posted March 5, 2009 (edited) As in, they want you to make one file called TIME.au3 with MsgBox(0,"", "The time is " & @HOUR & ":" & @MIN & ":" & @SEC) and one file called SCRIPT.au3 with #include "TIME.AU3" MsgBox(0,"", "Example") #include "TIME.AU3" Exit As a result you will notice that when you run SCRIPT.AU3 you will get ; Running script.au3 will output three message boxes: ; one with the time, one with 'Example', and another with the time. Basically they are just explaining to you that using #include just means that you are sticking the code from the other file that you reference into your current code. Edited March 5, 2009 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]
fade2gray Posted March 5, 2009 Author Posted March 5, 2009 (edited) you are supposed to create both files yourself in the same directory.Perhaps it would be more helpful if the help file read something like...;;; Create in ...\AutoIt\Include - TIME.AU3 ;;;;;; Create anywhere - SCRIPT.AU3 ;;;but thanks anyway.Sorry... SM - you got in there before I could hit the post button. Edited March 5, 2009 by fade2gray
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