Navigation

Operators and Keywords

Function List:

C++ API

Function File: h = msgbox (msg)
Function File: h = msgbox (msg, title)
Function File: h = msgbox (msg, title, icon)
Function File: h = msgbox (…, createmode)

Display msg using a message dialog box.

The message may have multiple lines separated by newline characters ("\n"), or it may be a cellstr array with one element for each line.

The optional input title (character string) can be used to decorate the dialog caption.

The optional argument icon selects a dialog icon. It can be one of "none" (default), "error", "help", or "warn".

The return value is always 1.

Compatibility Note: The optional argument createmode is accepted for MATLAB compatibility, but is not implemented.

See also: errordlg, helpdlg, inputdlg, listdlg, questdlg, warndlg.

Demonstration 1

The following code

 disp('- test msgbox message only.');
 msgbox("Below, you should see 3 lines:\nline #1\nline #2, and\nline #3.");

Produces the following output

- test msgbox message only.

Demonstration 2

The following code

 disp('- test msgbox message and caption.');
 msgbox('You should see a single line.','A msgbox');

Produces the following output

- test msgbox message and caption.

Package: octave