view scripts/ui/helpdlg.m @ 16933:e39f00a32dc7

maint: Use parentheses around condition for switch(),while(),if() statements. * libinterp/corefcn/dirfns.cc, libinterp/octave-value/ov-fcn-handle.cc, liboctave/array/Sparse.cc, scripts/image/rgb2ind.m, scripts/io/importdata.m, scripts/io/strread.m, scripts/optimization/fminbnd.m, scripts/optimization/sqp.m, scripts/plot/graphics_toolkit.m, scripts/plot/hdl2struct.m, scripts/plot/legend.m, scripts/plot/print.m, scripts/plot/printd.m, scripts/plot/private/__contour__.m, scripts/plot/private/__go_draw_axes__.m, scripts/plot/struct2hdl.m, scripts/polynomial/polyeig.m, scripts/sparse/bicg.m, scripts/specfun/ellipke.m, scripts/special-matrix/gallery.m, scripts/ui/errordlg.m, scripts/ui/helpdlg.m, scripts/ui/inputdlg.m, scripts/ui/listdlg.m, scripts/ui/questdlg.m, scripts/ui/warndlg.m: Use parentheses around condition for switch(),while(),if() statements.
author Rik <rik@octave.org>
date Tue, 09 Jul 2013 14:04:05 -0700
parents 6ae555fc8c43
children bc924baa2c4e
line wrap: on
line source

## Copyright (C) 2010 Martin Hepperle
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING.  If not, see
## <http://www.gnu.org/licenses/>.

## -*- texinfo -*-
## @deftypefn  {Function File} {@var{h} =} helpdlg (@var{msg})
## @deftypefnx {Function File} {@var{h} =} helpdlg (@var{msg}, @var{title})
## Display @var{msg} in a help 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 @var{title} (character string) can be used to
## set the dialog caption.  The default title is "Help Dialog".
##
## The return value is always 1.
## @seealso{errordlg, inputdlg, listdlg, msgbox, questdlg, warndlg}
## @end deftypefn

function retval = helpdlg (msg, title = "Help Dialog")

  if (nargin < 1 || nargin > 2)
    print_usage ();
  endif

  retval = message_dialog ("helpdlg", msg, title, "help");

endfunction


%!demo
%! disp ('- test helpdlg with a help message only.');
%! helpdlg ("Below, you should see 3 lines:\nline #1\nline #2, and\nline #3.");

%!demo
%! disp ('- test helpdlg with help message and caption.');
%! helpdlg ('You should see a single line.','A help dialog');