VB 中的循環,FOR,While,Do..Loop

1>For index=start to end[Step step]

[statements]

[Exit For]

[statements]

Next[index]

example:

For d = 0 To 2

System.Console.WriteLine("In the For Loop")

Next d

2>While condition

[statements]

wend

example

Dim d, e As Integer

d = 0

e = 6

While e > 4

e -= 1

d += 1

End While

3>Do[{while | Until} condition]

[statements]

[Exit Do]

[statements]

Loop

example:

Do Until str = "Cool"

System.Console.WriteLine("What to do?")

str = System.Console.ReadLine()

Loop