Navigation

Operators and Keywords

Function List:

C++ API

: h = msgbox (msg)
: h = msgbox (msg, title)
: h = msgbox (msg, title, icon)
: 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. A valid createmode is either one of the character strings "nonmodal", "modal", or "replace", or a structure containing a field "WindowStyle" with one of the three character strings.

Examples:

msgbox ("Some message for the user.");
msgbox ("Some message\nwith two lines.");
msgbox ({"Some message", "with two lines."});
msgbox ("Some message for the user.", "Fancy caption");

% A message dialog box with error icon
msgbox ("Some message for the user.", "Fancy caption", "error");

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

Package: octave