btw, if you call open, it will reset the @error value (or at least it should).
so, as example in your original post:
Code:

if @error
$nul = open(1,"some.log",5)
$nul = writeline(1,@error + " "+@serror)
$nul = close(1)
endif



this will always give you succesfull (error = 0) return, if the file opens ok.
to get the real error to the output, use something like:
Code:

if @error
$error = @error + " - " + @serror
$nul = open(1,"some.log",5)
$nul = writeline(1,$error)
$nul = close(1)
endif

_________________________
!

download KiXnet