Opened on Sep 29, 2013 at 1:14:12 PM
Closed on Oct 4, 2013 at 8:36:39 AM
#2488 closed Feature Request (Rejected)
@exitMethod - proposal - new mode - Accident
| Reported by: | mlipok | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
Please add a new mode to @exitMethod
I am referring to cases when the script finished its work by accident.
For example:
OnAutoItExitRegister('_OnExit')
Local $aTest[10]
Local $a = $aTest[12]
Func _OnExit()
MsgBox(4096, 'Test', @exitMethod & @CRLF & @exitCode)
EndFunc ;==>_DumpOnExit
Attachments (0)
Change History (5)
comment:2 by , on Sep 30, 2013 at 7:16:40 AM
for example by using incorrect number of subscripts or subscript dimension range exceeded.
or by using undefined function.
for example
Call('test')
without declaring Function 'test'
comment:3 by , on Sep 30, 2013 at 5:42:36 PM
Well your second example wouldn't cause AutoIt to exit anyway.
Why not just have a flag called $ExittedCleanly, then a custom exit() function, which you call instead of exit. The _OnExit() function can then check your flag to see whether it was set for a planned exit.
AutoIt has always been used in a way such that programming errors stop the interpreter, and if a piece of code is critical, then it should be checked for errors such as array bounds correctly. Trying to catch errors like this is the wrong way to go about it.
comment:4 by , on Oct 1, 2013 at 9:01:39 AM
So this request can be closed.
And by the way last night while lying in a fever I had an idea how to deal with a problem that's bothering me.
comment:5 by , on Oct 4, 2013 at 8:36:39 AM
| Resolution: | → Rejected |
|---|---|
| Status: | new → closed |

What do you mean by "by accident"? How do you (or the script) determine the exit wasn't intentional?