laphlaw 0 Posted June 28, 2005 Share Posted June 28, 2005 Whenever I try and include a custom-made function (we'll call it myfunction) my function always runs twice. For example..... #include<myfunction.au3> myfunction() The above script would run my function twice. It appears that autoit actually runs the function when I include it, then runs it again when I call it. The script shouldn't run when I just include it... am I missing something here?? Please help! Link to post Share on other sites
blindwig 1 Posted June 28, 2005 Share Posted June 28, 2005 Whenever I try and include a custom-made function (we'll call it myfunction) my function always runs twice. For example.....#include<myfunction.au3>myfunction()The above script would run my function twice. It appears that autoit actually runs the function when I include it, then runs it again when I call it. The script shouldn't run when I just include it... am I missing something here?? Please help!<{POST_SNAPBACK}>Yes, the script runs when you include. Yes, this is supposed to happen, because if any of the functions in the included script need certain global variables to be initialized before they work then the included script can initialize them.If don't want a function to run twice, then either don't call it in the original file, or don't bother calling it in the parent script. My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to post Share on other sites
BigBadWeirdo 0 Posted June 28, 2005 Share Posted June 28, 2005 i don't know if i'm right (just started autoit) but doesn't it help when you put the #include-once in your include file? Link to post Share on other sites
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