From bug-octave-request at bevo dot che dot wisc dot edu Wed Oct 18 14:08:34 2000 Subject: hex2dec.m hangs v 2.1.31 (i586-pc-cygwin) From: Ed Suominen To: bug-octave at bevo dot che dot wisc dot edu Date: Wed, 18 Oct 2000 14:08:22 -0500 hex2dec.m hangs my installation of Octave. No help for it but to exit the program and start it again. CTRL+C doesn't work. Running on Win 2000, everything else works fine. (Except having to run scripts and functions repeatedly with errors until everything compiles, but that's another post.) No problem with dec2hex.m Ed Suominen Registered Patent Agent Web Site: http://eepatents.com PGP Public Key: http://eepatents.com/key ---------------------------------- VERSION: GNU Octave, version 2.1.31 (i586-pc-cygwin). SAMPLE HISTORY: octave:6> type hex2dec hex2dec is the user-defined function defined from: /usr/local/share/octave/2.1.31/m/strings/h ex2dec.m ## Copyright (C) 1996 Kurt Hornik ## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (at your option) ## any later version. ## ## Octave is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, write to the Free ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. ## -*- texinfo -*- ## at deftypefn {Function File} {} hex2dec (@var{s}) ## Return the decimal number corresponding to the hexadecimal number stored ## in the string at var{s} dot For example, ## ## at example ## hex2dec ("12B") ## at result{} 299 ## hex2dec ("12b") ## at result{} 299 ## at end example ## at end deftypefn ## Author: Kurt Hornik ## Adapted-By: jwe function d = hex2dec (h) if (nargin != 1) usage ("hex2dec (x)"); endif if (isstr (h)) nr = rows (h); d = zeros (nr, 1); for i = 1:nr s = h (i, :); if (isxdigit (s)) tmp = sscanf (s, "%x"); if (isempty (tmp)) error ("hex2dec: invalid conversion"); else d (i) = tmp; endif else error ("hex2dec: argument must be a string of hexadecimal digits"); endif endfor else error ("hex2dec: expecting a string argument"); endif endfunction octave:7> hex2dec ("12b") ...and then to the abyss... ------------------------------------- Hope this is helpful. ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------