【发布时间】:2017-06-17 04:44:07
【问题描述】:
For a = 1 to 10
if a = dumm then next a 'this statement should avoid running the subsequent codes if the if statement is true (similar to continue in c++
end if
'statements that need to run when the if statement is not true
next a
为什么这段代码不起作用?它抛出编译错误:Next without for
【问题讨论】:
-
去掉next a,if语句中需要有动作
-
if a = dumm then a = a + 1 -
if a = dumm then goto...(这需要添加一个可以与goto语句一起使用的标签。 -
@mo.h 如果没有下一个 a 循环不会运行 10 次
-
@DavidZemens 运行剩余的代码。我不想那样。