help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

deblank and empty arguments


From: H. Wziontek
Subject: deblank and empty arguments
Date: Tue, 29 Jan 2008 09:34:30 +0100 (CET)

Hello,

I'd like to propose, that the function deblank should return
the argument itself instead of an error message if an empty
value is provided. Sometimes it can happen, that a value is
not defined, but for some reason, all values are "deblanked"
inside a loop. A script should not stop in such a case with
an error. Below my suggestion to change the code.

Hartmut


*** deblank.m.orig      Tue Jan 22 17:54:13 2008
--- deblank.m   Tue Jan 29 09:16:10 2008
*************** function s = deblank (s)
*** 34,39 ****
--- 34,41 ----
       print_usage ();
     endif

+   if (!isempty (s))
+
       if (ischar (s))

         k = find (! isspace (s) & s != "\0");
*************** function s = deblank (s)
*** 51,54 ****
--- 53,58 ----
         error ("deblank: expecting string argument");
       endif

+   endif
+
   endfunction


reply via email to

[Prev in Thread] Current Thread [Next in Thread]