Mercurial > hg > octave-lojdl
changeset 10718:b8d76f4be94a
Fix spreadsheet style range option (bug #30183).
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Mon, 21 Jun 2010 22:35:11 -0700 |
parents | 9d4a198614ab |
children | e54152088b0a 604e13a89c7f |
files | src/ChangeLog src/DLD-FUNCTIONS/dlmread.cc |
diffstat | 2 files changed, 15 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-06-21 Rik <octave@nomad.inbox5.com> + + * DLD-FUNCTIONS/dlmread.cc: Fix spreadsheet style range option. + (bug #30183). + 2010-06-21 David Bateman <dbateman@free.fr> * graphics.cc (std::string radio_values:values_as_string (void)
--- a/src/DLD-FUNCTIONS/dlmread.cc +++ b/src/DLD-FUNCTIONS/dlmread.cc @@ -55,10 +55,11 @@ char ch = is.get (); col *= 26; if (ch >= 'a') - col += ch - 'a'; + col += ch - 'a' + 1; else - col += ch - 'A'; + col += ch - 'A' + 1; } + col --; if (is) { @@ -151,7 +152,7 @@ DEFUN_DLD (dlmread, args, , "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {@var{data} =} dlmread (@var{file})\n\ +@deftypefn {Loadable Function} {@var{data} =} dlmread (@var{file})\n\ @deftypefnx {Loadable Function} {@var{data} =} dlmread (@var{file}, @var{sep})\n\ @deftypefnx {Loadable Function} {@var{data} =} dlmread (@var{file}, @var{sep}, @var{r0}, @var{c0})\n\ @deftypefnx {Loadable Function} {@var{data} =} dlmread (@var{file}, @var{sep}, @var{range})\n\ @@ -163,9 +164,12 @@ row and column of the data to be read. These values are indexed from zero,\n\ such that the first row corresponds to an index of zero.\n\ \n\ -The @var{range} parameter must be a 4 element vector containing the upper\n\ -left and lower right corner @code{[@var{R0},@var{C0},@var{R1},@var{C1}]} or\n\ -a spreadsheet style range such as 'A2..Q15'. The lowest index value is zero.\n\ +The @var{range} parameter may be a 4 element vector containing the upper\n\ +left and lower right corner @code{[@var{R0},@var{C0},@var{R1},@var{C1}]}\n\ +where the lowest index value is zero. Alternatively, a spreadsheet style\n\ +range such as 'A2..Q15' or 'T1:AA5' can be used. The lowest alphabetical\n\ +index 'A' refers to the first column. The lowest row index is 1.\n\ +@seealso{csvread,dlmwrite}\n\ @end deftypefn") { octave_value_list retval;