Version 2 will be broken before launch //other code. Version 1 will not be checked until the next iteration begins.
bool noErrors = true;
while(noErrors)
{
noErrors = ValidateControl(txtName);
}
Checks before each iteration.
bool noErrors = true;
do
{
noErrors = ValidateControl(txtName);
} while(noErrors);
Checks after each iteration.
. , , , txtName ? - ?
while (ValidateControl(txtName))
{
}
txtName , ,
if (ValidateControl(txtName))
{
while()
{
}
}