DaLiMan Posted September 10, 2004 Share Posted September 10, 2004 I'm having an error which sounds somewhat like: Error: Excursion level has exceeded - Auto It it trying to prevent a stack overflow. Can someone tell me what all this means? And more important, how to prevent it?? Link to comment Share on other sites More sharing options...
DaLiMan Posted September 10, 2004 Author Share Posted September 10, 2004 that means that this is a nonoFunc SomeFunction() SomeFunction() EndFuncdo not call a function within itself... <{POST_SNAPBACK}>OK. Any quick ideas of making the script better stuctured? Link to comment Share on other sites More sharing options...
redndahead Posted September 10, 2004 Share Posted September 10, 2004 My guess is that your checking to see if you need to run the function again and then trying to run it again Do this: $MyFunc=0 While NOT $MyFunc $MyFunc=SomeFunction() Wend Func SomeFunc() If it works Return(1) Else Return(0) EndFunc red Link to comment Share on other sites More sharing options...
DaLiMan Posted September 10, 2004 Author Share Posted September 10, 2004 @redndahead That's right. I'm gonna change it like you you sayd. 10X Link to comment Share on other sites More sharing options...
ezzetabi Posted September 10, 2004 Share Posted September 10, 2004 Actually it can be useful recall a func from inside itself. But, rember to Retun just line after... Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted September 11, 2004 Share Posted September 11, 2004 What's this? AutoIt doesn't support recursion??? Hmmm... note to self... bug jon about adding into next release... *** Matt @ MPCS Link to comment Share on other sites More sharing options...
this-is-me Posted September 11, 2004 Share Posted September 11, 2004 It does support recursion, but not unlimited recursion. Recursion in any well-rounded script only serves to confuse the maker of the script and is not a good coding practice. That is why the error is currently there. Who else would I be? Link to comment Share on other sites More sharing options...
ezzetabi Posted September 11, 2004 Share Posted September 11, 2004 (edited) I found it useful when you have to 'correct' what the user input. E.g. a non case sensitive string, the user input, the first part of the script check if it is fully lowercase. if it is it continues otherwise it makes it lowercase and restarts. Of course this simple case can be solved with just a IF, but sometime in more complex loops you may need it. But... RETURN!!! Edited September 11, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
DaLiMan Posted September 13, 2004 Author Share Posted September 13, 2004 Actually it can be useful recall a func from inside itself. But, rember to Retun justĀ line after... <{POST_SNAPBACK}>How's that? Can you give me an little example code? Link to comment Share on other sites More sharing options...
ezzetabi Posted September 13, 2004 Share Posted September 13, 2004 (edited) Little example. It is little and it can solved elsehow, but it may give you an idea. ;$test keep a program to run $test='program' _Run($test) Exit Func _Run($input) If Not FileExist($input) AND FileExist($input & '.exe') Then _Run($input & '.exe') Return EndIf Run($input) EndFunc Edited September 13, 2004 by ezzetabi 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