Mercurial > octave-nkf
annotate scripts/miscellaneous/namelengthmax.m @ 20654:b65888ec820e draft default tip gccjit
dmalcom gcc jit import
author | Stefan Mahr <dac922@gmx.de> |
---|---|
date | Fri, 27 Feb 2015 16:59:36 +0100 |
parents | 4197fc428c7d |
children |
rev | line source |
---|---|
19731
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19226
diff
changeset
|
1 ## Copyright (C) 2008-2015 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 () |
19226
8a8a7bc2a09d
Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
21 ## Return the @sc{matlab} compatible maximum variable name length. |
8a8a7bc2a09d
Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
22 ## |
8a8a7bc2a09d
Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
23 ## Octave is capable of storing strings up to @math{2^{31} - 1} in length. |
8a8a7bc2a09d
Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
24 ## However for @sc{matlab} compatibility all variable, function, and structure |
8a8a7bc2a09d
Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
25 ## field names should be shorter than the length returned by |
8a8a7bc2a09d
Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
26 ## @code{namelengthmax}. In particular, variables stored to a @sc{matlab} file |
8a8a7bc2a09d
Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
27 ## format (@file{*.mat}) will have their names truncated to this length. |
7628
acca752a3b96
Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
28 ## @end deftypefn |
acca752a3b96
Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
29 |
acca752a3b96
Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
30 function n = namelengthmax () |
acca752a3b96
Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
31 n = 63; |
acca752a3b96
Add the namelengthmax function
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
32 endfunction |
13761
2d574194718c
namelengthmax.m: Consolidate docstring by using @math macro. Add %!test.
Rik <octave@nomad.inbox5.com>
parents:
12575
diff
changeset
|
33 |
2d574194718c
namelengthmax.m: Consolidate docstring by using @math macro. Add %!test.
Rik <octave@nomad.inbox5.com>
parents:
12575
diff
changeset
|
34 |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
35 %!assert (namelengthmax (), 63) |
17338
1c89599167a6
maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents:
14363
diff
changeset
|
36 |