Sub showerror ()
Dim s As String
Dim crlf As String
crlf = Chr(13) + Chr(10)
s = "运行时发生下列错误:" + crlf
注释:add the error string
s = s + Error$ + crlf
注释:add the error number
s = s + "错误码为: " + CStr(Err)
Beep 注释:beep and show the error
X= MsgBox (s,2)
End Sub
调用例子:
sub abc()
onerror goto 1’发生错误时转到 1
.
.
程序体
.
.
exit sub
1
showerror
if err=… then
.
.
错误处理部分
.
.
endif
exit sub
end sub
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/
领测软件测试网最新更新
关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073









