Opened 12 years ago
Closed 12 years ago
#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:1 by , 12 years ago
comment:2 by , 12 years ago
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 , 12 years ago
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 , 12 years ago
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 , 12 years ago
| Resolution: | → Rejected |
|---|---|
| Status: | new → closed |

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