deblank and empty arguments

John W. Eaton jwe at bevo.che.wisc.edu
Wed Jan 30 01:37:42 CST 2008


On 29-Jan-2008, H. Wziontek wrote:

| 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

I checked in the following change instead.

It's best to report bugs to the bug at octave.org list.

Thanks,

jwe


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: https://www.cae.wisc.edu/pipermail/help-octave/attachments/20080130/44d35e60/attachment.ksh 


More information about the Help-octave mailing list