WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Postie

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Email Error Information


ErrorCount = 0

:StartOver
IntControl(73,1,0,0,0); Turn on error handling

if ErrorCount >= 1 then exit

; Main Code
Message("This line will cause an error"); Force an error
exit


:WBERRORHANDLER
ErrorCount = ErrorCount+1
Error=LastError()
msg = StrCat("LastError Value is ",Error,@crlf)
msg = StrCat(msg,"wberrorhandlerline: ", wberrorhandlerline,@crlf)
msg = StrCat(msg,"wberrorhandleroffset: ", wberrorhandleroffset,@crlf)
msg = StrCat(msg,"wberrorhandlerassignment: ", wberrorhandlerassignment,@crlf)
msg = StrCat(msg,"wberrorhandlerfile: " ,wberrorhandlerfile,@crlf)
msg = StrCat(msg,"wberrortextstring: ", wberrortextstring,@crlf)
msg = StrCat(msg,"wberroradditionalinfo: ", wberroradditionalinfo,@crlf)


; == Email Reminder ==
host="mail.server.com" ; host added here
fromaddr="user@server.com" ; add from here
userid="" ; no username needed for simple SMTP 
password="" ; ditto above
port=""
tolist="admin@server.com" ; add to here 
cclist="" ; add cc here if needed
bcclist=""
subject="Script Failure" ; add subject here
attachments=""
flags=""

AddExtender("wwpst34i.dll")

kInit (host,fromaddr,userid,password,port)
kDest (tolist,cclist,bcclist)
ret = kSendText(subject,msg,attachments,flags) 
if ret == 0
	errline=kStatusInfo()
	Message("ErrLine",errline)
endif

Goto StartOver



Article ID:   W16348
File Created: 2017:07:28:13:58:34
Last Updated: 2005:02:18:12:19:57