Mercurial > hg > octave-lyh
diff src/pr-output.cc @ 1343:94bedeb289e5
[project @ 1995-09-04 00:29:21 by jwe]
author | jwe |
---|---|
date | Mon, 04 Sep 1995 00:42:19 +0000 |
parents | ec2ab864e8eb |
children | 9e41dbb74bca |
line wrap: on
line diff
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -25,11 +25,13 @@ #include <config.h> #endif +#include <cstring> +#include <cmath> +#include <cfloat> + #include <iostream.h> #include <strstream.h> -#include <string.h> -#include <math.h> -#include <float.h> + #include <Complex.h> #include "dMatrix.h" @@ -41,6 +43,7 @@ #include "user-prefs.h" #include "pr-output.h" #include "mappers.h" +#include "oct-str.h" #include "sysdep.h" #include "pager.h" #include "help.h" @@ -1389,7 +1392,6 @@ if (pr_as_read_syntax) { - if (free_format) { os << base << " : "; @@ -1451,6 +1453,32 @@ } } +void +octave_print_internal (ostream& os, Octave_str_obj& s, + int pr_as_read_syntax) +{ + int nstr = s.num_strings (); + + if (pr_as_read_syntax && nstr > 1) + os << "[ "; + + for (int i = 0; i < nstr; i++) + { + if (pr_as_read_syntax) + { + os << "\"" << s.elem (i) << "\""; + + if (i < nstr - 1) + os << "; "; + } + else + os << s.elem (i) << "\n"; + } + + if (pr_as_read_syntax && nstr > 1) + os << " ]"; +} + DEFUN ("disp", Fdisp, Sdisp, 1, 1, "disp (X): display value without name tag") {