for i = 1 to 10
if i = 5 then
'这里要跳到下一个i
else
debug.print i
end if
next输出应该是1 2 3 4 6 7 8 9 10的数列
不要用goto
if i = 5 then
'这里要跳到下一个i
else
debug.print i
end if
next输出应该是1 2 3 4 6 7 8 9 10的数列
不要用goto
解决方案 »
- 一个vb的字符串处理问题,急,老大帮忙!入者有分
- 我想实现这样得极具有挑战性的功能,请高人指点
- 求救打印的问题,急!在线等!
- 求助:关于COMBO 控件.
- xp下通过任务计划执行一VB程序获取桌面路径问题
- (ROWLOCK HOLDLOCK) 和 with(ROWLOCK HOLDLOCK)有什么区别?
- 报表问题!
- 小问题(送分):求控件toolbar和imagelist的用法、属性讲解、范例!
- 请教一个关于Vb出错的问题??已使我从装过n次VB了
- 急急急急急急!!!!MSHFlexGrid绑定Adodc,当用鼠标选定一行时,为什么不能用Adodc.RecordSet.Field来定位??有什么办法与Adodc联系起来???
- VB与VS.NET能安在一起吗?
- 安装程序控件及相关文件打包,用的是setupbuilder
if i <>5 then
debug.print i
end if
next
if i<>5 then
debug.print i
end if
if i = 5 then
'这里什么都不写
else
debug.print i
end if
next
for i = 1 to 10
if i = 5 then
'这里要跳到下一个i
else
debug.print i
end if
next
可以改成:
for i = 1 to 10
if i <> 5 then debug.print i
next
这不就结了吗?
结构化的程序是根本不需要GOTO这个东西的,只要有分支,循环,判断这三种方法就可以得到任意的逻辑结构。
我的问题是vb里有没有这种功能,上面只是个最简单的例子,你这种写法我当然知道,可是和我的需求根本是两码事