Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Initialize a WB Error IntControl (79, Intcontrol(79, user defined error
value = inireadpvt("section", "value", "novalue", inifile) if value == "novalue" then set_error :WBERRORHANDLER ret = LastError() dowritefile(logfile, pcname, ret) Exiti hope you can understand my need.
IntControl (73, 2, 0, 0, 0) IntControl (79,-1, 7001, "7001: Minor ERROR!", 0) IntControl (79,-2, 7002, "7002: Moderate ERROR!!", 0) IntControl (79,-3, 7003, "7003: Severe ERROR!!!", 0) exit :WBERRORHANDLER wbError = LastError() wbTextcode=wbError if wberror==1668 || wberror==2669 || wberror==3670 msg=IntControl(34,-1,0,0,0) wberror=ItemExtract(1,msg,":") wbTextcode = -1 endif wbErrorMsg = "" wbErrorMsg = StrCat(wbErrorMsg,"LastError value:",@LF,wbError,@LF,@LF) wbErrorMsg = StrCat(wbErrorMsg,"LastError string:",@LF,IntControl(34,wbTextcode,0,0,0),@LF,@LF) If ItemLocate(wbError,"1668,2669,3670",",") ; 1668 ; "Minor user-defined error" ; 2669 ; "Moderate user-defined error" ; 3670 ; "Severe user-defined error" wbErrorMsg = StrCat(wbErrorMsg,"User-defined error:",@LF,IntControl(34,-1,0,0,0),@LF,@LF) EndIf ; Line in script that caused Error. wbErrorMsg = StrCat(wbErrorMsg,"wbErrorHandlerLine:",@LF,wbErrorHandlerLine,@LF,@LF) ; Offset into script of error line, in bytes. wbErrorMsg = StrCat(wbErrorMsg,"wbErrorHandlerOffset:",@LF,wbErrorHandlerOffset,@LF,@LF) ; Variable being assigned on error line, or "" if none. wbErrorMsg = StrCat(wbErrorMsg,"wbErrorHandlerAssignment:",@LF,wbErrorHandlerAssignment,@LF,@LF) If (wbErrorhandlerassignment>"") Then %wbErrorhandlerassignment% = "eeek" Message("wbErrorHandler",wbErrorMsg) IntControl (73, 2, 0, 0, 0) Return Exit
Article ID: W15496
File Created: 2003:05:13:11:28:14
Last Updated: 2003:05:13:11:28:14