Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continue For Loop in OpenOffice Basic

Is there a way to continue a loop in OpenOffice Basic like in other language?

For i = 0 To 10

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

Next i

I know the Syntax Exit For to break a loop but I have to skip some iterations... Thank you in advance!

like image 721
Viatorus Avatar asked Sep 05 '25 11:09

Viatorus


1 Answers

AFAIK there isn't, but you also can use the If clause to skip certain iterations:

For i = 0 To 10

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

Next i

Of course, using something like Continue would be better style, since the If clause as proposed seems to handle an exception, not the normal case.

like image 56
tohuwawohu Avatar answered Sep 09 '25 20:09

tohuwawohu