请教达人,vb的循环有没有像C++中 continue 这样的语句。------没有就是当出错时候,跳出当前循环,继续执行下一条循环。并不是结束该循环。---在循环前写上: On Error Resume Next例如: On Error Resume Next for i = 0 to 100 i = i + 1 next
Resume Next 与C语言里continue ;是有区别的Resume Next :执行下一条语句continume;: 结束当前循环,继续执行下一条循环
楼上的意思是On Error Resume Next这样不行吗?
可以采用另外的办法:如 dim N as integerfor N =1 to 100 step 1 on Error goto Next N --- ------ -------- Next N也可以如下设置标签:for N =1 to 100 step 1 on Error goto handler --- ------ -------- handler: Next N
On Error Resume Next
for i = 0 to 100
i = i + 1
next
dim N as integerfor N =1 to 100 step 1
on Error goto Next N
---
------
--------
Next N也可以如下设置标签:for N =1 to 100 step 1
on Error goto handler
---
------
--------
handler:
Next N