在OpenOffice Basic中继续循环

时间:2015-12-22 06:51:29

标签: openoffice.org openoffice-basic

有没有办法像其他语言一样在OpenOffice Basic中继续循环?

For i = 0 To 10

  If i = 5 Then
     Continue For # Not working
  End If  

Next i

我知道语法退出来打破循环,但我必须跳过一些迭代...提前谢谢你!

3 个答案:

答案 0 :(得分:2)

AFAIK还没有,但您也可以使用If子句跳过某些迭代:

For i = 0 To 10

  If i <> 5 Then
     # Execute some commands except in the fifth iteration
  End If  

Next i

当然,使用像Continue之类的东西会更好,因为提议的If子句似乎处理异常,而不是正常情况。

答案 1 :(得分:0)

遇到同样的问题,通过将迭代器等同于自身来解决问题,即i = i。

答案 2 :(得分:0)

For i = 0 To 10

  If i = 5 Then
     GoTo Continue 
  End If  


Continue:
Next i