annotate scripts/legacy/setstr.m @ 25720:e9f107d31799

warning_ids.m: Document new Octave:legacy-function warning. * warning_ids.m: Document new Octave:legacy-function warning. * setstr.m: Wrap some comments to 80 characters rather than 72.
author Rik <rik@octave.org>
date Wed, 01 Aug 2018 12:42:03 -0700
parents a3448e97ccc8
children a0923a7878e3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25715
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 ## Copyright (C) 2003-2018 John W. Eaton
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 ##
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 ## This file is part of Octave.
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 ##
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 ## your option) any later version.
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 ##
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 ## General Public License for more details.
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 ##
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 ## -*- texinfo -*-
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 ## @deftypefn {Function File} {} setstr (@var{s})
25718
a3448e97ccc8 new scripts/legacy directory for Matlab functions that refuse to die
John W. Eaton <jwe@octave.org>
parents: 25715
diff changeset
21 ## This function is obsolete. Use char instead.
25715
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 ## @end deftypefn
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 ## Author: jwe
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
25720
e9f107d31799 warning_ids.m: Document new Octave:legacy-function warning.
Rik <rik@octave.org>
parents: 25718
diff changeset
26 ## At one time, Matlab docs stated that this function is obsolete and would be
e9f107d31799 warning_ids.m: Document new Octave:legacy-function warning.
Rik <rik@octave.org>
parents: 25718
diff changeset
27 ## removed in some future version. Now users are told that it should be
e9f107d31799 warning_ids.m: Document new Octave:legacy-function warning.
Rik <rik@octave.org>
parents: 25718
diff changeset
28 ## avoided, but there is no mention of possible future removal.
25715
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 function retval = setstr (varargin)
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 persistent warned = false;
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 if (! warned)
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 warned = true;
25718
a3448e97ccc8 new scripts/legacy directory for Matlab functions that refuse to die
John W. Eaton <jwe@octave.org>
parents: 25715
diff changeset
35 warning ("Octave:legacy-function",
a3448e97ccc8 new scripts/legacy directory for Matlab functions that refuse to die
John W. Eaton <jwe@octave.org>
parents: 25715
diff changeset
36 "setstr is obsolete; please use char instead");
25715
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 endif
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 retval = char (varargin{:});
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40
216321ca4cc4 revive setstr (bug #54417)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 endfunction