From bug-octave-request at bevo dot che dot wisc dot edu Fri Jan 28 12:13:13 2000 Subject: Re: fscanf From: "John W. Eaton" To: Francesco Potorti` Cc: Octave bugs list Date: Fri, 28 Jan 2000 12:13:34 -0600 (CST) On 28-Jan-2000, Francesco Potorti` wrote: | | I am not wrong, there is no way to tell how many parameters a fscanf | | function call has read, when the "C" argument is used. This is a serious | | shortcoming. | | Hmm. Any ideas about how should this be fixed? | | Just add one more returned value, which is the number of items that have | been read: | | [V1, V2, ..., COUNT] = sscanf (STRING, TEMPLATE, "C") OK, for some reason (brain failure) I was thinking that this wouldn't work, but I suppose it will, provided that the number of conversions matches the number of `Vn' output arguments. If it doesn't, you probably have a bug anway. I was actually thinking that it would be much nicer to have sscanf return a list of values (then you could just get the length of the list to see how many conversions happened). I don't really want to make a backwardly incompatible change, but would add it as another alternative ("CL" instead of "C", I suppose) if there is sufficient interest. Thanks, jwe ----------------------------------------------------------------------- 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 -----------------------------------------------------------------------