en5bot Posted July 8, 2006 Share Posted July 8, 2006 (edited) I checked around using the search button and I noticed the solution varies from script to script so I figured I should post mine here so you guys can have a look: Help please. Usually happens when the script's already running for a while.en5bot.au3 Edited July 8, 2006 by en5bot Link to comment Share on other sites More sharing options...
Nomad Posted July 8, 2006 Share Posted July 8, 2006 I checked around using the search button and I noticed the solution varies from script to script so I figured I should post mine here so you guys can have a look:Help please.Usually happens when the script's already running for a while.You need to let your functions complete and return. You are calling new functions from inside of functions and never letting them finish. After you have called about 384 functions without letting them finish, AutoIt shuts down the program because the recursion level has been exceeded. You need to restructure your script so your functions can return.The best way to do this is to make a main function which calls all of your other functions. THen when a called function is finished, it can return to the main function so another functions can be called. You can use variables and set conditions to determine what function needs to be called.Nomad Link to comment Share on other sites More sharing options...
en5bot Posted July 8, 2006 Author Share Posted July 8, 2006 You need to let your functions complete and return. You are calling new functions from inside of functions and never letting them finish. After you have called about 384 functions without letting them finish, AutoIt shuts down the program because the recursion level has been exceeded. You need to restructure your script so your functions can return.The best way to do this is to make a main function which calls all of your other functions. THen when a called function is finished, it can return to the main function so another functions can be called. You can use variables and set conditions to determine what function needs to be called.Nomad Oh, I see, thanksBut is there any chance you can give me an example for a function that doesnt finish and how to call it from the script? just for additional understanding.Thanks in advance. Link to comment Share on other sites More sharing options...
Nomad Posted July 8, 2006 Share Posted July 8, 2006 Oh, I see, thanks But is there any chance you can give me an example for a function that doesnt finish and how to call it from the script? just for additional understanding. Thanks in advance.expandcollapse popupGlobal $v Func Main () Select Case $v = 1 Func_1 () Case $v = 2 Func_2 () Case $v = 3 Func_3 () Case $v = 4 Exit EndSelect EndFunc Func Func_1 () If 1 = 1 Then $v = 2 Else $v = 3 EndIf EndFunc Func Func_2 () If 1 = 2 Then $v = 1 Else $v = 3 EndIf EndFunc Func Func_3 () If 1 = 2 Then $v = 2 Else $v = 4 EndIf EndFunc That's an example way to structure your script. Nomad 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