for
for (int icount = 2; icount <= 20; ivalue++)
{
break; //terminates the closest ending loop or switch
}
For icount = 1 to 20 'the variable is automatically declared
Next icount
For icount As Integer = 1 to 20 'the variable is declared on the same line
Next icount
Dim icount As Integer 'the variable is declared earlier
For icount = 1 to 20
Next icount
for (reverse)
for (icount = 20; icount > -1; ivalue--)
{
}
For icount As Integer = 20 to 1 Step -1
Next icount
Continue
The continue statement transfers execution to the next iteration within the loop
for (int icount = 2; icount <=10; icount++)
{
if (icount = 6) {
continue;
}
}
For icount As Integer = 2 To 10
If (icount = 6) Then
Continue For
End If
Next
© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext