What you want to do is to check the minimum number of times.
bool oklength = PassLength(password);
bool okdigit = containDigit(password);
while (!okLength || !okDigit)
{
if (!okLength)
// err MSG
if (!okDigit)
// err MSG
// get password again
oklength = PassLength(password);
okdigit = containDigit(password);
}
__________________
Talk nerdy to me.
|