Modify

Opened 11 years ago

Closed 11 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 Changed 11 years ago by BrewManNH

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

comment:2 Changed 11 years ago by mlipok

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 Changed 11 years ago by Mat

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 Changed 11 years ago by mlipok

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 Changed 11 years ago by Jpm

  • Resolution set to Rejected
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.