bugGNU Octave - Bugs: bug #52618, [octave forge] (io) A bug in the...

 
 

bug #52618: [octave forge] (io) A bug in the xlswrite.m

Submitter:  None
Submitted:  Thu 07 Dec 2017 10:32:27 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Alexej Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * other
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 29 Dec 2017 09:28:29 PM UTC, comment #2: 

No response from OP for ~3 weeks.
Closing report with "invalid".

Philip Nienhuis <philipnienhuis>
Group Member
Fri 08 Dec 2017 08:47:22 AM UTC, comment #1: 

Remarkable as in io-2.4.8 the very first statement of xlswrite.m after the function statement on L.128 shows:


       :
   120 ##
   121 ## @end deftypefn
   122
   123 ## Author: Philip Nienhuis <prnienhuis at users.sf.net>
   124 ## Created: 2009-10-16
   125
   126 function [ rstatus ] = xlswrite (filename, arr, arg3, arg4, arg5)
   127
   128   rstatus = r_extnd = 0;
   129
       :


(see here:
http://hg.code.sf.net/p/octave/io/file/47fe0439ac07/inst/xlswrite.m
so it is currently beyond me where "r_extnd undefined" error comes from.
Furthermore in the latest xlswrite.m the first reference to r_extnd is at L.171, not L.175 as in your case.

This rather makes me suspicious that you have a stale xlswrite.m somewhere in your path or in your working directory.
In the octave terminal, what does

which xlswrite

return?

What you can do anyway is just download the proper file (use the URL above) and replace your xlswrite function in the io package with that one. Should be in <OCTAVE_HOME>/share/octave/packages/io-2.4.8 or something like that.

Philip Nienhuis <philipnienhuis>
Group Member
Thu 07 Dec 2017 10:32:27 PM UTC, original submission:  

A few days ago I downloaded and installed the io-package on my machine and tried out a simple example of writing an array into an excel spreadsheet:


arr= {'Date', 'Time', 'Value'; ...
      '01.07.2017', '09:00:01.500', '20.7'; ...
      '01.07.2017', '09:00:04.730', '-2.0'};

status= xlswrite('C:/myData/tmp/myExcel.xlsx', arr, 'FirstDataSet')


but encountered the error message


error: 'r_extnd' undefined near line 175 column 27
error: called from
    xlswrite at line 175 column 3


A look into the mentioned code line revealed that indeed the variable r_extnd is defined in a special case only:


  elseif (nargin >= 4)
    wsh = arg3;
    crange = arg4;
    r_extnd = (isempty (strfind (crange, ":")) && nargin >= 4);
  endif


without understanding the entire code in detail, I think the code line is misplaced and must be put outside of the elseif branch (the AND-connection with the condition nargin >= 4 ensures that only in that case the content is meaningfull):


  elseif (nargin >= 4)
    wsh = arg3;
    crange = arg4;
    %r_extnd = (isempty (strfind (crange, ":")) && nargin >= 4);
  endif

  %my modification
  r_extnd = (isempty (strfind (crange, ":")) && nargin >= 4);


Maybe I overlook some side effects, but at least for me that modification works fine.

Consider a correction for the next release and please let me know if there is a better proposal for the correction.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-02 jwe Summary[octave-forge] A bug in the xlswrite.m (io-2.4.8) [octave forge] (io) A bug in the xlswrite.m
    2017-12-29 philipnienhuis StatusNeed Info Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2017-12-08 philipnienhuis StatusNone Need Info
        Release4.2.0 other
        SummaryA bug in the xlswrite.m (io-2.4.8) [octave-forge] A bug in the xlswrite.m (io-2.4.8)

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code