Opened 7 years ago

Last modified 7 years ago

#2375 new Feature Request

Change default return value for SetError and SetExtended

Reported by: MHz Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


Functions default to a 0 return value. Use of SetError or SetExtended sets a return value of 1 unless the return value parameter is used. The difference between 0 and 1 has always been ill behavior and always will be ill behavior until both return values use 0 by default.

People use all of the parameters to avoid the unpleasent default of 1 set by SetError and SetExtended. Anyone, which I have not seen, who uses the default of 1 needs to review their code as relying on 1 is not good especially since the help file states none as returned in .

A 0 return by default has and always will be preferred and 1 is a usability bug.

$var = _Test()
MsgBox(0, 'Expect 1 returned', $var)

Func _Test()
	Return SetError(1)

Note that I have done a quick review of STD UDFs for compliance and I have submitted the bugs for 4 of them. So hopefully little to no affect will happen when the change is made.

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by Jon

  • Type changed from Bug to Feature Request

comment:2 Changed 7 years ago by TicketCleanup

  • Version deleted

Automatic ticket cleanup.

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

as new The ticket will remain with no owner.

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

Note: See TracTickets for help on using tickets.