Jump to content

Recommended Posts

Posted (edited)

Just noticed this inconsistency with error handling, when using Execute.
Maybe this is common knowledge?
It seems AutoIt does not handle errors when using Execute, but only for the most recent usage? some internal flag being toggled on call and reset on first return?

 

Code without using Execute:

Func a()
    Local $a = [123]
    Return $a[0][1]
EndFunc
a()

Result:

Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
Return $a[0][1]
Return ^ ERROR

 


 

Code using execute:

Func a()
    Local $a = [123]
    Return $a[0][1]
EndFunc
Execute("a()")

Result: No error

 


 

Code using a second Execute within another Execute run:

Func a()
    Execute("")
    Local $a = [123]
    Return $a[0][1]
EndFunc
Execute("a()")

Result:

Array variable has incorrect number of subscripts or subscript dimension range exceeded.:
Return $a[0][1]
Return ^ ERROR
Edited by genius257
Added hr elements between cases
Posted (edited)
2 minutes ago, argumentum said:

All I see is logical in my experience. No flaw.

I would agree, if using a Execute call within a Execute call did not turn errors on again

Edited by genius257

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
  • Recently Browsing   0 members

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