Custom Query

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (154 - 156 of 3856)

Ticket Resolution Summary Owner Reporter
#876 Rejected @error passthrough on 'Return' statements Ascendant
Description

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)

#1536 No Bug @errorcode produces a run-time error jer_826@…
Description

@errorcode produces a run-time error "Error: Unknown macro"

#2488 Rejected @exitMethod - proposal - new mode - Accident mlipok
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
Note: See TracQuery for help on using queries.