cheeseandcereal Posted March 21, 2013 Share Posted March 21, 2013 (edited) So I am writing a script and I am at a point where I have a variable, I want to add 1 to that variable, then do a quick process with that variable, then repeat, but when I write something as simple as this: Folder() Func Folder() $Count += 1 ;Insert quick function using $Count here If $Count < 15000 Then Folder() Else NextFunc() EndIf EndFunc Func NextFunc() ;Insert anything you want here EndFunc AutoIT will stop because "Recursion level has been exceeded - AutoIt will quit to prevent stack overflow." after about 3,898 recurrences consistently. The problem is I want to run this for 10,000-100,000 times. Is there anyway to circumvent this limitation? Edited March 21, 2013 by cheeseandcereal Link to comment Share on other sites More sharing options...
stormbreaker Posted March 21, 2013 Share Posted March 21, 2013 Recursion is not a cool technique. Why not try looping? $Count = 0 Func _MyFunc() While $Count < 15000 $Count = $Count + 1 ;Do something with $Count here WEnd EndFunc Func _NextFunc() ;Anything you wanna do!!! EndFunc ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1 Link to comment Share on other sites More sharing options...
kylomas Posted March 21, 2013 Share Posted March 21, 2013 cheeseandcrereal, This follows the logic of your post, although it makes no sense outside of the context of the rest of your script. for $Count = 1 to 15000 Folder() Next NextFunc() Func Folder() ; do something EndFunc ;==>Folder Func NextFunc() ;Insert anything you want here EndFunc ;==>NextFunc Are you trying to run folders and files? kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
cheeseandcereal Posted March 21, 2013 Author Share Posted March 21, 2013 Haha now I feel stupid! I knew there was some sort of loop that could do this for me I just couldn't remember what it was for some reason. Brain fart Thanks 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