Whats the difference between do while and while in VB.NET?
In DO...WHILE, the code inside the loop is executed at least once
In WHILE Loop, the code inside the loop is executed 0 or more times.
In Visual Basic these are identical:
Dim foo As Boolean = True
While Not foo
Debug.WriteLine("!")
End While
Do While Not foo
Debug.WriteLine("*")
Loop
These are not; the do
executes once:
Dim foo As Boolean = True
While Not foo
Debug.WriteLine("!")
End While
Do
Debug.WriteLine("*")
Loop While Not foo