Apparently, you can create Do ... Loop without a condition. The following code compiles with .NET 4.5 ( fiddle ), as well as Roslyn ( fiddle ):
Public Sub Main() Do Console.WriteLine("Hello World") Exit Do Loop End Sub
However, the grammar on the documentation page offers only the following two options:
Do { While | Until } condition [ statements ] [ Continue Do ] [ statements ] [ Exit Do ] [ statements ] Loop -or- Do [ statements ] [ Continue Do ] [ statements ] [ Exit Do ] [ statements ] Loop { While | Until } condition
Is this a bug in the compiler, a bug in the documentation, or just didn't look complicated enough?
source share