Continue code if Message box OK is pressed

I have a code in which during middle of the code i have a message box. I want to continue the code only if the user clicks OK to that, otherwise abort the code. i donot want to use 'YES/NO' dialogue.

1 comentario

Jan
Jan el 20 de Abr. de 2017
And what should happen if the user does not press the button? Nothing?

Iniciar sesión para comentar.

Respuestas (3)

Abdul Asad
Abdul Asad el 20 de Abr. de 2017

1 voto

I am getting this error
Undefined function or variable 'AutoWarnDlg'.

1 comentario

Jan
Jan el 24 de Abr. de 2017
I've posted the link to the FileExchange, where you can download this function for free. Again and with full link: https://www.mathworks.com/matlabcentral/fileexchange/24871-autowarndlg

Iniciar sesión para comentar.

Jan
Jan el 20 de Abr. de 2017
See as example FEX: AutoWarnDlg:
Opt.Delay = 15;
Opt.Button = {'Ok'}; % 1st is default
[Reply, TimeOut] = AutoWarnDlg({'Question', 'Press Ok to proceed'}, 'Question', Opt);
if ~TimeOut % Dialog closed by time out ==> User did not press Ok:
return;
end

Categorías

Más información sobre Downloads en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 20 de Abr. de 2017

Comentada:

Jan
el 24 de Abr. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by