Mercurial > octave-antonio
changeset 20084:4d0c7fec0a31
doc: Explain treatment of strings by isindex() (bug #44855).
* utils.cc (Fisindex): Add explanation of how strings are treated by isindex.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 17 Apr 2015 09:09:52 -0700 |
parents | ade6e5ae6164 |
children | c58cf3a65519 |
files | libinterp/corefcn/utils.cc |
diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/utils.cc Fri Apr 17 08:58:47 2015 -0700 +++ b/libinterp/corefcn/utils.cc Fri Apr 17 09:09:52 2015 -0700 @@ -1356,11 +1356,16 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isindex (@var{ind})\n\ @deftypefnx {Built-in Function} {} isindex (@var{ind}, @var{n})\n\ -Return true if @var{ind} is a valid index. Valid indices are\n\ -either positive integers (although possibly of real data type), or logical\n\ -arrays. If present, @var{n} specifies the maximum extent of the dimension\n\ -to be indexed. When possible the internal result is cached so that\n\ -subsequent indexing using @var{ind} will not perform the check again.\n\ +Return true if @var{ind} is a valid index.\n\ +\n\ +Valid indices are either positive integers (although possibly of real data\n\ +type), or logical arrays. If present, @var{n} specifies the maximum extent\n\ +of the dimension to be indexed. When possible the internal result is cached\n\ +so that subsequent indexing using @var{ind} will not perform the check again.\n\ +\n\ +Implementation Note: Strings are first converted to double values before the\n\ +checks for valid indices are made. Unless a string contains the NULL\n\ +character \"\\0\", it will always be a valid index.\n\ @end deftypefn") { octave_value retval;