It's my password program with locked property. It's okay, but first of all why Cancel button doesn't work? also there's a simple problem with this locked property: if you enter your password incorrectly three times, first of all 'Try again' will show and then 'LOCKED!'. you know this feature isn't interesting. I want to show ONLY one message that's LOCKED!
if (strcmp(pass,password))
uiwait(msgbox('Welcome!'));
break;
else
uiwait(errordlg('Try again!'));
wrong = wrong + 1;
if (wrong == 3)
lock = true;
break;
end
end
end
if (lock)
uiwait(errordlg('LOCKED!'));
return;
end

 Respuesta aceptada

Walter Roberson
Walter Roberson el 9 de Dic. de 2017

0 votos

else
wrong = wrong + 1;
if (wrong == 3)
lock = true;
break;
else
uiwait(errordlg('Try again!'));
end

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 9 de Dic. de 2017

Editada:

el 10 de Dic. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by