📄 程序1.prg
字号:
*指定错误处理例程
on error do DealError with error(),sys(16),program(),lineno(),message(),message(1)
use xyz.dbf &&打开不存在的表,产生错误
return
*定义错误处理过程
procedure DealError
parameters nError,cFile,cProgram,nLineno,cMsg,cLine
cCr=chr(13)+chr(10) &&获得换行符
cstr="程序发生错误,错误信息如下:" + cCr
cstr=cstr+"错误代号:" + alltrim(str(nError)) + cCr
cstr=cstr+"错误信息:" + cMsg + cCr
cstr=cstr+"语句行号:" + alltrim(str(nLineno))+ cCr
cstr=cstr+"出错代码:" + cLine+ cCr
cstr=cstr+"程序名称:" + cProgram + cCr
cstr=cstr+"程序文件:" + cFile
messagebox(cstr,16,"错误处理范例")
return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -