genius257 Posted January 28 Posted January 28 (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 February 10 by genius257 Added hr elements between cases To show your appreciation My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser
argumentum Posted January 28 Posted January 28 19 minutes ago, genius257 said: It seems AutoIt does not handle errors when using Execute, Ain't that a nice feature. This is common. If the func() has an error, fix it. If execute("@oppsItDontExist") will not be a crash. All I see is logical in my experience. No flaw. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
genius257 Posted January 28 Author Posted January 28 (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 January 28 by genius257 To show your appreciation My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser
genius257 Posted January 28 Author Posted January 28 (edited) Accidental second reply Edited January 28 by genius257 To show your appreciation My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser
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