comparison scripts/java/helpdlg.m @ 15748:54e8c2527a9e

style and doc fixes for newly imported Java package .m files * java/cell2mlstr.m, java/errordlg.m, java/helpdlg.m, java/inputdlg.m, java/javaArray.m, java/javaaddpath.m, java/javaclasspath.m, java/javafields.m, java/javamem.m, java/javamethods.m, java/javarmpath.m, java/listdlg.m, java/msgbox.m java/questdlg.m, java/warndlg.m: Style and doc fixes.
author John W. Eaton <jwe@octave.org>
date Fri, 07 Dec 2012 17:21:27 -0500
parents da26f72408a7
children 05c781cca57e
comparison
equal deleted inserted replaced
15747:4be890c5527c 15748:54e8c2527a9e
15 ## You should have received a copy of the GNU General Public License 15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see 16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>. 17 ## <http://www.gnu.org/licenses/>.
18 18
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Function file} {@var{P} =} helpdlg (@var{MESSAGE} [,@var{TITLE}]) 20 ## @deftypefn {Function file} {@var{p} =} helpdlg (@var{msg} ,@var{title}])
21 ## Display @var{msg} in a help dialog box.
21 ## 22 ##
22 ## Displays a @var{MESSAGE} in a help dialog box. 23 ## The message may have multiple lines separated by newline characters
24 ## (@code{"\n"}), or it may be a cellstr array with one element for each
25 ## line. The optional @var{title} (character string) can be used to
26 ## decorate the dialog caption.
23 ## 27 ##
24 ## @var{message} can have multiple lines separated by newline characters
25 ## ("\n"), or it can be a cellstr array (one element for each line).
26 ## The optional @var{TITLE} (character string) can be used to decorate the
27 ## dialog caption.
28 ## The return value is always 1. 28 ## The return value is always 1.
29 ## 29 ## @seealso{errordlg, inputdlg, listdlg, questdlg, warndlg}
30 ## @end deftypefn 30 ## @end deftypefn
31 ## @seealso{errordlg, inputdlg, listdlg, questdlg, warndlg}
32 31
33 function ret = helpdlg (message, varargin) 32 function retval = helpdlg (message, varargin)
34 33
35 if (! ischar (message)) 34 if (! ischar (message))
36 if (iscell (message)) 35 if (iscell (message))
37 message = cell2mlstr (message); 36 message = cell2mlstr (message);
38 else 37 else
39 error ("helpdlg: character string or cellstr array expected for message"); 38 error ("helpdlg: character string or cellstr array expected for message");
40 endif 39 endif
41 endif 40 endif
42 41
43 switch length (varargin) 42 switch length (varargin)
44 case 0 43 case 0
45 title = "Help Dialog"; 44 title = "Help Dialog";
46 otherwise 45
47 if (ischar (varargin {1})) 46 otherwise
48 title = varargin{1}; 47 if (ischar (varargin {1}))
49 else 48 title = varargin{1};
50 error ("helpdlg: character string expected for title"); 49 else
51 endif 50 error ("helpdlg: character string expected for title");
51 endif
52 endswitch 52 endswitch
53 53
54 if (! ischar (title)) 54 if (! ischar (title))
55 error ("helpdlg: character string expected for title"); 55 error ("helpdlg: character string expected for title");
56 endif 56 endif
57 57
58 ret = java_invoke ("org.octave.JDialogBox", "helpdlg", message, title); 58 retval = java_invoke ("org.octave.JDialogBox", "helpdlg", message, title);
59 59
60 endfunction 60 endfunction