Sign in to follow this  
Followers 0
FadetoGrey

How to create functions without them actually executing from the declaration?

3 posts in this topic

So I put what function I want at the top of my code, but it always does what the function says to do, but I only want it to execute when I call the function. How can I make it do this?

Share this post


Link to post
Share on other sites



So I put what function I want at the top of my code, but it always does what the function says to do, but I only want it to execute when I call the function. How can I make it do this?

Declaring a function alone does not call the function when your script runs, unless you named the function OnAutoItStart/OnAutoItExit.

If it's being called, there has to be a line in your code or an include that is calling it.


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

If it's being called, there has to be a line in your code or an include that is calling it.

@FadetoGrey

Are you using an #include statement for the file that has your function in it?

Most likely cause is that you have code in the included file that's launching right away.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0