Quote:

instead of doing this complex error reporting UDF, why don't you just display the errors after each of the functions and commands.
if you want errorlog udf, something simple as the one below should do exactly what you already do:
Code:



function LogErrors()
if @error
$errorString = @wksta + "--> " + @serror + " (" + @error + ")"
$=RedirectOutput($ErrorFile)
$errorString ?
endif
endfunction






Thank you for the help. It is far better than my function. I have to learn a lot. BUT still I am getting the same problem. I am still getting ZEROS in the log file.

Should I put
Code:
 
$rc = ? "File not opened, error code: [" + $ErrorValue + "]"
If NOT $rc=0
? $rc
EndIf



BUT this gives me an error.
Plz. let me know what is missing?