VertigoRay Posted June 30, 2008 Share Posted June 30, 2008 I have two au3 files and I would like to backwards reference a function from an included file.What do I mean by this? Simply stated, I have a script file 1.au3 and I am including 2.au3. I would like to reference the function a_test in 1.au3 from 2.au3 after it is included. How would I go about this?Here is a quick example.1.au3#include "2.au3" Func a_test() MsgBox(0, 'Test', 'It worked!') EndFunc ;==>a_testoÝ÷ Úȳz쥩ì·)^Result of this is:2.au3 : ERROR: a_test(): undefined function.How do I reference a_test() so that the MsgBox pops up? Figure IT out!http://vertigion.com Link to comment Share on other sites More sharing options...
James Posted June 30, 2008 Share Posted June 30, 2008 You call the function. a_test() Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
VertigoRay Posted June 30, 2008 Author Share Posted June 30, 2008 You call the function. a_test() So basically I've got compile issues. Let me reinstall autoit and hope for the best. Thanks. Figure IT out!http://vertigion.com Link to comment Share on other sites More sharing options...
cartman380 Posted June 30, 2008 Share Posted June 30, 2008 Why not have all of your functions in it's own script then include that in both of the seperate scripts. Still not certain if that's what you're looking for but that's the best I can figure from the code you have. Link to comment Share on other sites More sharing options...
YellowLab Posted June 30, 2008 Share Posted June 30, 2008 (edited) I think you have the "#include" backwards: 1.au3 should be Func a_test() MsgBox(0,"test","It worked") EndFunc 2.au3 should be #include "1.au3" a_test() Bob Edited June 30, 2008 by YellowLab You can't see a rainbow without first experiencing the rain. Link to comment Share on other sites More sharing options...
VertigoRay Posted June 30, 2008 Author Share Posted June 30, 2008 (edited) You call the function.This was correct. I re-installed the compiler and it worked ... /shrug.Why not have all of your functions in it's own script then include that in both of the seperate scripts.Cause I'm making a library of functions that will be included in many scripts. They will be managed by a set of functions in the main script that calls the library.I think you have the "#include" backwardsIncludes were not backwards, but thank you for your time and response. Edited June 30, 2008 by VertigoRay Figure IT out!http://vertigion.com 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