﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
876	@error passthrough on 'Return' statements	Ascendant		"It would be nice to be able to use 'Return MyFunction()' to both return the values from that function *and* the @error/@extended codes.  It looks ridiculous, and is probably wasteful to change the below code:

{{{
Func _ReturnErr()
    Return SetError(1,0,1)
EndFunc

Func _ReturnReturnErr()
    Return _ReturnErr()
EndFunc

_ReturnReturnErr()
If @error Then ConsoleWrite(""Error returned correctly""&@CRLF)
}}}

to this code:

{{{
Func _ReturnErr()
    Return SetError(1,0,1)
EndFunc

Func _ReturnReturnErr()
    ; Wasteful temporary storage
    $tempVal=_ReturnErr()
    ; This looks ridiculous, setting @error to @error:
    If @error Then SetError(@error,@extended)
    Return $tempVal
EndFunc

_ReturnReturnErr()
If @error Then ConsoleWrite(""Error returned correctly""&@CRLF)
}}}

I recognize that there is function 'localization', but I believe that 'Return FunctionName()' makes more sense to return the value AND the @error\@extended code information. It would save extra work and make more sense in the end.

Actually, even better -  I recommend a new keyword - something like 'ReturnWithSubError', which will take the last @error + @extended codes returned by a called function and return them as the @error/@extended values.

This will prevent breaking old code, and make code clearer, easier, and more sensible.  Code with SetError(@error) looks (and is) ridiculous, in my opinion. (Sorry, don't mean to offend)"	Feature Request	closed		AutoIt		None	Rejected		
