comparison scripts/deprecated/nfields.m @ 20349:bcf0a288aa6c stable

maint: Merge default to stable in preparation for 4.0.0 release.
author John W. Eaton <jwe@octave.org>
date Tue, 28 Apr 2015 12:12:16 -0400
parents 4197fc428c7d
children
comparison
equal deleted inserted replaced
20065:77f65eabac20 20349:bcf0a288aa6c
1 ## Copyright (C) 2014-2015 Rik Wehbring
2 ##
3 ## This file is part of Octave.
4 ##
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
9 ##
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
18
19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {} nfields (@var{s})
21 ## Return the number of fields of the structure @var{s}.
22 ##
23 ## @strong{Warning:} @code{nfields} is scheduled for removal in version 4.4.
24 ## Use @code{numfields} instead.
25 ## @seealso{numfields, fieldnames}
26 ## @end deftypefn
27
28 ## Deprecated in 4.0
29
30 function retval = nfields (varargin)
31
32 persistent warned = false;
33 if (! warned)
34 warned = true;
35 warning ("Octave:deprecated-function",
36 "nfields is obsolete and will be removed from a future version of Octave; please use numfields instead");
37 endif
38
39 if (nargin < 1)
40 print_usage ();
41 endif
42
43 retval = numfields (varargin{:});
44
45 endfunction
46