diff scripts/io/strread.m @ 11469:c776f063fefe

Overhaul m-script files to use common variable name between code and documentation.
author Rik <octave@nomad.inbox5.com>
date Sun, 09 Jan 2011 12:41:21 -0800
parents 5e5c513ea4c5
children 1740012184f9
line wrap: on
line diff
--- a/scripts/io/strread.m
+++ b/scripts/io/strread.m
@@ -99,13 +99,13 @@
 ## @seealso{textread, load, dlmread, fscanf}
 ## @end deftypefn
 
-function varargout = strread (str, formatstr = "%f", varargin)
+function varargout = strread (str, format = "%f", varargin)
   ## Check input
   if (nargin < 1)
     print_usage ();
   endif
  
-  if (!ischar (str) || !ischar (formatstr))
+  if (!ischar (str) || !ischar (format))
     error ("strread: first and second input arguments must be strings");
   endif
 
@@ -150,10 +150,10 @@
   endif
 
   ## Parse format string
-  idx = strfind (formatstr, "%")';
-  specif = formatstr ([idx, idx+1]);
+  idx = strfind (format, "%")';
+  specif = format ([idx, idx+1]);
   nspecif = length (idx);
-  idx_star = strfind (formatstr, "%*");
+  idx_star = strfind (format, "%*");
   nfields = length (idx) - length (idx_star);
 
   if (max (nargout, 1) != nfields)
@@ -187,8 +187,8 @@
   endif
 
   ## Determine the number of words per line
-  formatstr = strrep (formatstr, "%", " %");
-  [~, ~, ~, fmt_words] = regexp (formatstr, "[^\\s]+");
+  format = strrep (format, "%", " %");
+  [~, ~, ~, fmt_words] = regexp (format, "[^\\s]+");
 
   num_words_per_line = numel (fmt_words);
   for m = 1:numel(fmt_words)