Jump to content

Tracing a recursion level error


Recommended Posts

Alternative example:

global $HK_fIns = false
HotKeySet("{INS}", "_HK_INS")
func _HK_INS()
  $HK_fIns = true
endfunc
func wait()
  ;; some loop
  if $HK_fIns then
    $HK_fIns = false
    ;; do this
  endif
  ;; some other code.
endfunc

Woah dude... That is some cool code.

Yeah, I know how nub that makes me sound, because you probably wrote that in 2 minutes, and probably not even in SciTe.

I'll try working that into the script, and see how that goes.

Link to comment
Share on other sites

Yup. Now the script stops at whatever number I have set for the limit. Which is good in one way, because I don't have a recursive error.

But the original concept was to be able to continue to perform installations until the program was manually stopped. Is there some way to get AutoIT to continuously do a script for a over-the-weekend project? Because I'm tired of going into work in the morning and seeing this error.

Edited by TheRauchster101
Link to comment
Share on other sites

Okay, I think I have found an answer, though it's probably not the best way to do it, as long as it works, I don't care.

Does this look like an acceptable recursion avoidance procedure while keeping the script to continuously loop?

Global $Starting=0
HotKeySet("{INS}", "Starting")
 
While 1=1
    If $Starting=0 Then
        Sleep(500)
    ElseIf $Starting=1 Then
        $Starting=2
        Call("PixelCheck")
    ElseIf $Starting=2 Then
        Call("Start")
    EndIf
WEnd
 
Func Starting()
    $Starting=1
EndFunc

Where Func PixelCheck() is my one time only script that takes the snapshot of the installation window to compare against for future reference against errors, and Func Start() is the starting function of the installation procedure? I've also removed any possible loops back to "Start", making sure it's called nowhere else in the script.

Does this make sense to others?

Edited by TheRauchster101
Link to comment
Share on other sites

To me there is only one acceptable "recursion avoidance procedure" ... Finding the reason and fixing it. Anything else not making any sens. (unless your on a deadline to get some work stuff done. But it should still be seen as a temporary workaround ...)

Not looked at that code ... Got some other code problem floating in my head at the moment.

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...