编程论坛
注册
登录
编程论坛
→
ASP技术论坛
[求助]如何跳过出错的语句
nbsyf
发布于 2007-10-30 14:57, 404 次点击
请教如何使程序运行在到出错语句时,跳过出错的语句,继续运行下一句语句。我记得有这语句,但忘了。能帮助我一下吗?谢谢!
3 回复
#2
永夜的极光
2007-10-30 15:38
在函数开头写on error resume next
#3
nbsyf
2007-10-30 16:25
回复:(永夜的极光)在函数开头写on error resume ne...
出错的语句是下面,由于表结构变动而找不到xs.fields.item(ksdm)
<div align="center"><%=xs.fields.item(ksdm)%></div>
我照您讲的把上面语句改成<div align="center"><%on error resume next
=xs.fields.item(ksdm)
=""%></div>
原意是想让程序在找不到xs.fields.item(ksdm)时用空格显示,但
结果还是运行到=xs.fields.item(ksdm)这句时出错,错误提示仍然是找不到xs.fields.item(ksdm)
请教,我应该如何才能在找不到xs.fields.item(ksdm)时用空格显示。
#4
永夜的极光
2007-10-30 17:54
on error resume next这句要放在函数的最开头,如果你这个不是放在函数里面的,那就写在整个文件的最前面
如果要换成空格的话,你把前面的代码也贴出来吧,光这里好像不好改
1