well it's the same code I was asking about the other day:

Code:
function ErrorLog($ErrorMsg)
DIM $LogFile,$LogError,$AltLogFile,$error,$serror,$ErrorString

$error = @ERROR
$serror = @SERROR
$ErrorString = "@WKSTA,@USERID,@DATE,@TIME,$error,$serror,$ErrorMsg,@CRLF"
$LogFile = "\\server\SoftwarePushes\sms\logging\@Year_@MonthNo_@MDayNo.xls"
$AltLogFile = "\\server\SoftwarePushes\sms\logging\@Year_@MonthNo_@MDayNo-@WKSTA.xls"
$LogError = OPEN (5,$LogFile,5)

If $LogError=0
$ = WRITELINE(5,$ErrorString)
$ = CLOSE(5)
Else
$ = OPEN (6,$AltLogFile,5)
$ = WRITELINE(6,$ErrorString)
$ = CLOSE (6)
EndIf
endfunction



Edited by thepip3r (2005-05-16 11:47 PM)