annotate scripts/miscellaneous/namelengthmax.m @ 17535:c12c688a35ed default tip lyh

Fix warnings
author LYH <lyh.kernel@gmail.com>
date Fri, 27 Sep 2013 17:43:27 +0800
parents 1c89599167a6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 13761
diff changeset
1 ## Copyright (C) 2008-2012 David Bateman
7628
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
2 ##
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
3 ## This file is part of Octave.
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
4 ##
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
8 ## your option) any later version.
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
9 ##
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
13 ## General Public License for more details.
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
14 ##
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
18
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
19 ## -*- texinfo -*-
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
20 ## @deftypefn {Function File} {} namelengthmax ()
12575
d0b799dafede Grammarcheck files for 3.4.1 release.
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
21 ## Return the @sc{matlab} compatible maximum variable name length. Octave is
13761
2d574194718c namelengthmax.m: Consolidate docstring by using @math macro. Add %!test.
Rik <octave@nomad.inbox5.com>
parents: 12575
diff changeset
22 ## capable of storing strings up to @math{2^{31} - 1} in length.
2d574194718c namelengthmax.m: Consolidate docstring by using @math macro. Add %!test.
Rik <octave@nomad.inbox5.com>
parents: 12575
diff changeset
23 ## However for @sc{matlab} compatibility all variable, function,
7628
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
24 ## and structure field names should be shorter than the length supplied by
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 9037
diff changeset
25 ## @code{namelengthmax}. In particular variables stored to a @sc{matlab} file
7628
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
26 ## format will have their names truncated to this length.
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
27 ## @end deftypefn
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
28
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
29 function n = namelengthmax ()
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
30 n = 63;
acca752a3b96 Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff changeset
31 endfunction
13761
2d574194718c namelengthmax.m: Consolidate docstring by using @math macro. Add %!test.
Rik <octave@nomad.inbox5.com>
parents: 12575
diff changeset
32
2d574194718c namelengthmax.m: Consolidate docstring by using @math macro. Add %!test.
Rik <octave@nomad.inbox5.com>
parents: 12575
diff changeset
33
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
34 %!assert (namelengthmax (), 63)
17346
1c89599167a6 maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents: 14363
diff changeset
35