Sign in to follow this  
Followers 0
BrewManNH

MaxRecursion level changed lately

7 posts in this topic

I was reading a topic recently regarding using recursion to check something and in that thread the poster was complaining that he was getting a stack overflow and the script would shut down. I created a script that all it does is to print a variable on the console of Scite, and then calls itself.

According to the help file, the MaxCallRecurse value is 5200, meaning that the maximum times a function can call itself is 5200 times, the function posted below when run for me on Windows 7 x64 will get to 1900 times (running it using the "#AutoIt3Wrapper_UseX64=n" directive it will run up to 3900 times), and then quits with an error message. Can anyone test this function for me and let me know what you're getting for the last value of $I, what OS you're running and the OSArch?

$I = 0
Test()
Func Test()
    $I += 1
    ConsoleWrite(' $I = ' & $I & @CRLF ) ;### Debug Console
    Call("Test")
EndFunc   ;==>Test

I realize the value is called the MAXcalrecurse value, and its description says "Maximum number of times the Call() function can recurse to itself.", but I am wondering if either the description should be changed to reflect that it might not be able to get to that number of times? I don't want to put in a Trak ticket if I'm just missing something stupid here. ;)


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Win7 "#AutoIt3Wrapper_UseX64=n" - 3899

Win7 "#AutoIt3Wrapper_UseX64=y" - 1899

XP x86 - 3899

My XP x64 machine is down

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

And what game is this for?

JK

3899 - XP x86 VM

3899 - 7 x64

Share this post


Link to post
Share on other sites

3899 - win7x86, no directives


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

I'm pretty sure the actual limit and the one noted in the helpfile hasn't been close for years.

but I am wondering if either the description should be changed to reflect that it might not be able to get to that number of times?I

Isn't that was maximum means? But I agree that it could be better. Less precise since we can't (?) guarantee the numbers.

don't want to put in a Trak ticket if I'm just missing something stupid here. ;)

You are not. But helpfile suggestions should ideally go in the thread, not in trac.

Share this post


Link to post
Share on other sites

;
;
;
local $i
recurse()
func recurse()
 $i+=1
 consolewrite($i & @lf)
 recurse()
EndFunc

3899 - XP/SP3 Pro


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

Share this post


Link to post
Share on other sites

Well, I'm glad that it isn't just me that is seeing the same numbers as you all are reporting. I rounded up to the next number because it looked neater, should have just left it at 1899 and 3899 for accuracy.

As to what it means by maximum, I was thinking along the lines of "theoretically it should be able to reach a maximum of 5200 repetitions, but only under ideal conditions, YMMV."


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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