Inside Do....Loop, can i trigger next loop base on parameter

lets say i am inside a simple do…loop, i want to add some rows to a listbox and i want to skip one occasionally based on a math parameter…

can i do an if… then statement that triggers the next Do(loop)?
thanx

The Continue keyword jumps to the end of the current loop:

Do
   If foo=True Then
     Continue 
   End If
Loop

This works for all loop types (For/While/Do).

5 Likes
Do
   If a Mod 12 <> 0 Then
     // Add a Row in that Case
     // Code that add a Row
   End If

If UserCancelled Then Exit // No Infinite loop
Loop

other method:
Var dico As New Dictionary
Var LB As DesktopListBox

dico.value ( 1 ) = “aa”
dico.value ( 2 ) = “zz”
dico.value ( 3 ) = “ee”
dico.value ( 4 ) = “rr”

For Each de As DictionaryEntry In dico
Select Case de.Key
Case “rr” , “ee”
// ne pas ajouter / do nothing
Else
lb.AddRow ( de.Key , de.Value )
End Select
Next

Exception err
Break
//