Modify

Opened 13 years ago

Closed 6 years ago

Last modified 6 years ago

#2375 closed Feature Request (Completed)

Change default return value for SetError and SetExtended

Reported by: MHz Owned by: J-Paul Mesnage
Milestone: 3.3.15.4 Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

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 3.3.8.1 .

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)
EndFunc

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 (4)

comment:1 by Jon, 13 years ago

Type: BugFeature Request

comment:2 by TicketCleanup, 13 years ago

Version: 3.3.9.13

Automatic ticket cleanup.

comment:3 by J-Paul Mesnage, 6 years ago

Milestone: 3.3.15.4
Owner: set to J-Paul Mesnage
Resolution: Completed
Status: newclosed

Added by revision [12370] in version: 3.3.15.4

comment:4 by J-Paul Mesnage, 6 years ago

to avoid SCRIPT BREAKING only doc is clarified

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.