On Error Do myError With Error(),Message(),Message(1),Program(),Lineno(),Lineno(1)
Procedure myError
Parameter lnError,lcMessage,lcMessage1,lcProgram,lnLineno,lnLineno1
Set Textmerge To "&pcAppDir.\ErrorLog.ini" Additive Noshow
\------------------------------------------------------------
\<<Date()>> <<Time()>>
错误记录
\计算机名:<<Sys(0)>>
\错误代号:<<lnError>>
\出错位置:<<lcProgram>>
\错误行号:<<lnLineno>>
\错误代码:<<lcMessage1>>
\错误含义:<<lcMessage>>
Set Textmerge To
nValue=msg("程序发生错误!详细信息如下:"+Chr(13)+Chr(13)+;
"错误代号:" + Alltrim(Str(lnError)) + Chr(13) + ;
"出错位置:" + lcProgram + Chr(13) + ;
"错误行号:" + Alltrim(Str(lnLineno)) + Chr(13) + ;
"错误代码:" + lcMessage1 + Chr(13) + ;
"错误含义:" + lcMessage1,2+48+512)
Do Case
Case nValue=3
Clear Events
For i=_Screen.FormCount To 1 Step -1
_Screen.Forms(i).Release
Endfor
Case nValue=4
Retry
Case nValue=5
Return
Endcase
Endproc