D Documentation  
Do-While Statement
The do-while-statement has a quite similar functionality to the normal while-statement.

do
{
  statement;
} while ( /* boolean expression */ );


The only difference is that the condition is evaluated after executing the statement inside the brackets. Thus, the statement is executed at least once.

Example:
int i = 1;
do
{
  writefln("Executed the statement with i = %d", i);
} while ( i < 1 );

Output:
Executed the statement with i = 1

Opposed to:
int i = 1;
while ( i < 1 )
{
  writefln("Executed the statement with i = %d", i);
}

Output:

(Doesn't output anything because i is 1 at the first check!)
Created using PHP docwiki written by Markus Dangl. Best viewed with Mozilla Firefox.