comparison 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
comparison
equal deleted inserted replaced
1342:61bb2bdee11e 1343:94bedeb289e5
23 23
24 #ifdef HAVE_CONFIG_H 24 #ifdef HAVE_CONFIG_H
25 #include <config.h> 25 #include <config.h>
26 #endif 26 #endif
27 27
28 #include <cstring>
29 #include <cmath>
30 #include <cfloat>
31
28 #include <iostream.h> 32 #include <iostream.h>
29 #include <strstream.h> 33 #include <strstream.h>
30 #include <string.h> 34
31 #include <math.h>
32 #include <float.h>
33 #include <Complex.h> 35 #include <Complex.h>
34 36
35 #include "dMatrix.h" 37 #include "dMatrix.h"
36 #include "CMatrix.h" 38 #include "CMatrix.h"
37 #include "Range.h" 39 #include "Range.h"
39 #include "tree-const.h" 41 #include "tree-const.h"
40 #include "variables.h" 42 #include "variables.h"
41 #include "user-prefs.h" 43 #include "user-prefs.h"
42 #include "pr-output.h" 44 #include "pr-output.h"
43 #include "mappers.h" 45 #include "mappers.h"
46 #include "oct-str.h"
44 #include "sysdep.h" 47 #include "sysdep.h"
45 #include "pager.h" 48 #include "pager.h"
46 #include "help.h" 49 #include "help.h"
47 #include "error.h" 50 #include "error.h"
48 #include "utils.h" 51 #include "utils.h"
1387 int fw; 1390 int fw;
1388 set_format (r, fw); 1391 set_format (r, fw);
1389 1392
1390 if (pr_as_read_syntax) 1393 if (pr_as_read_syntax)
1391 { 1394 {
1392
1393 if (free_format) 1395 if (free_format)
1394 { 1396 {
1395 os << base << " : "; 1397 os << base << " : ";
1396 if (increment != 1.0) 1398 if (increment != 1.0)
1397 os << increment << " : "; 1399 os << increment << " : ";
1447 1449
1448 col += inc; 1450 col += inc;
1449 } 1451 }
1450 } 1452 }
1451 } 1453 }
1454 }
1455
1456 void
1457 octave_print_internal (ostream& os, Octave_str_obj& s,
1458 int pr_as_read_syntax)
1459 {
1460 int nstr = s.num_strings ();
1461
1462 if (pr_as_read_syntax && nstr > 1)
1463 os << "[ ";
1464
1465 for (int i = 0; i < nstr; i++)
1466 {
1467 if (pr_as_read_syntax)
1468 {
1469 os << "\"" << s.elem (i) << "\"";
1470
1471 if (i < nstr - 1)
1472 os << "; ";
1473 }
1474 else
1475 os << s.elem (i) << "\n";
1476 }
1477
1478 if (pr_as_read_syntax && nstr > 1)
1479 os << " ]";
1452 } 1480 }
1453 1481
1454 DEFUN ("disp", Fdisp, Sdisp, 1, 1, 1482 DEFUN ("disp", Fdisp, Sdisp, 1, 1,
1455 "disp (X): display value without name tag") 1483 "disp (X): display value without name tag")
1456 { 1484 {