changeset 25718:216321ca4cc4 stable

revive setstr (bug #54417) * scripts/deprecated/setstr.m: Restore deleted function. * scripts/deprecated/module.mk: Update.
author John W. Eaton <jwe@octave.org>
date Wed, 01 Aug 2018 13:35:26 -0400
parents 5625b2237a4d
children fc410b574693 337c944a9ac9
files scripts/deprecated/module.mk scripts/deprecated/setstr.m
diffstat 2 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/deprecated/module.mk	Wed Aug 01 12:24:21 2018 -0400
+++ b/scripts/deprecated/module.mk	Wed Aug 01 13:35:26 2018 -0400
@@ -13,6 +13,7 @@
   %reldir%/onenormest.m \
   %reldir%/paren.m \
   %reldir%/semicolon.m \
+  %reldir%/setstr.m \
   %reldir%/sleep.m \
   %reldir%/tmpnam.m \
   %reldir%/toascii.m \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/deprecated/setstr.m	Wed Aug 01 13:35:26 2018 -0400
@@ -0,0 +1,40 @@
+## Copyright (C) 2003-2018 John W. Eaton
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} setstr (@var{s})
+## This function has been deprecated.  Use char instead.
+## @end deftypefn
+
+## Author: jwe
+
+## Deprecated in version 3.0
+## Matlab still has this function, so don't remove just yet.
+
+function retval = setstr (varargin)
+
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "setstr is obsolete and will be removed from a future version of Octave; please use char instead");
+  endif
+
+  retval = char (varargin{:});
+
+endfunction