Could this be easier to implement, or even usefull ?

Making a new function OnError() that will return output from @Error to an assigned Function (Calling that function each time the output differs from 0 and discarding 0)

OnError('FunctionName') ; Pipe @Error to assigned function

OnError(0) ; Pipe @Error back to standard: display or assigned variable.

The last example from Radimus could then look like this:
OnError("WriteValueError")
; Errors piped to UDF, No $= needed
writevalue()
writevalue()
writevalue()
writevalue()
writevalue()
OnError(0) ; @Error back to standardoutput

; Example 1
Function WriteValueError() ; On Error Quit
$x=@Error ; @Error = Implicit input for this function
exit 1
EndFunction

; Example 2
Function WriteValueError() ; On Error Continue (Resume next)
; Do nothing
EndFunction

; Example 3
Function WriteValueError() ; On Error do something
$x=@Error
; Write $x to errorlog or whatever you want
EndFunction

-Erik

[ 14. November 2002, 00:36: Message edited by: kholm ]