Mercurial > octave
comparison src/ov-base.cc @ 5794:1138ced03f14
[project @ 2006-05-08 20:23:04 by jwe]
author | jwe |
---|---|
date | Mon, 08 May 2006 20:23:07 +0000 |
parents | 6b9cec830d72 |
children | acb4a1e0b311 |
comparison
equal
deleted
inserted
replaced
5793:395382df0d8a | 5794:1138ced03f14 |
---|---|
58 | 58 |
59 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_base_value, | 59 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_base_value, |
60 "<unknown type>", "unknown"); | 60 "<unknown type>", "unknown"); |
61 | 61 |
62 // If TRUE, print the name along with the value. | 62 // If TRUE, print the name along with the value. |
63 static bool Vprint_answer_id_name; | 63 static bool Vprint_answer_id_name = true; |
64 | 64 |
65 // If TRUE, turn off printing of results in functions (as if a | 65 // If TRUE, turn off printing of results in functions (as if a |
66 // semicolon has been appended to each statement). | 66 // semicolon has been appended to each statement). |
67 static bool Vsilent_functions; | 67 static bool Vsilent_functions = false; |
68 | 68 |
69 octave_value | 69 octave_value |
70 octave_base_value::squeeze (void) const | 70 octave_base_value::squeeze (void) const |
71 { | 71 { |
72 std::string nm = type_name (); | 72 std::string nm = type_name (); |
1094 INSTALL_WIDENOP (octave_base_value, octave_complex_matrix, complex_matrix_conv); | 1094 INSTALL_WIDENOP (octave_base_value, octave_complex_matrix, complex_matrix_conv); |
1095 INSTALL_WIDENOP (octave_base_value, octave_char_matrix_str, string_conv); | 1095 INSTALL_WIDENOP (octave_base_value, octave_char_matrix_str, string_conv); |
1096 INSTALL_WIDENOP (octave_base_value, octave_cell, cell_conv); | 1096 INSTALL_WIDENOP (octave_base_value, octave_cell, cell_conv); |
1097 } | 1097 } |
1098 | 1098 |
1099 static int | 1099 DEFUN (print_answer_id_name, args, nargout, |
1100 print_answer_id_name (void) | 1100 "-*- texinfo -*-\n\ |
1101 { | 1101 @deftypefn {Built-in Function} {@var{val} =} print_answer_id_name ()\n\ |
1102 Vprint_answer_id_name = check_preference ("print_answer_id_name"); | 1102 @deftypefnx {Built-in Function} {@var{old_val} =} print_answer_id_name (@var{new_val})\n\ |
1103 | 1103 Query or set the internal variable that controls whether variable\n\ |
1104 return 0; | 1104 names are printed along with results produced by evaluating an expression.\n\ |
1105 } | 1105 @end deftypefn") |
1106 | 1106 { |
1107 static int | 1107 return SET_INTERNAL_VARIABLE (print_answer_id_name); |
1108 silent_functions (void) | 1108 } |
1109 { | 1109 |
1110 Vsilent_functions = check_preference ("silent_functions"); | 1110 DEFUN (silent_functions, args, nargout, |
1111 | 1111 "-*- texinfo -*-\n\ |
1112 return 0; | 1112 @deftypefn {Built-in Function} {@var{val} =} silent_functions ()\n\ |
1113 } | 1113 @deftypefnx {Built-in Function} {@var{old_val} =} silent_functions (@var{new_val})\n\ |
1114 | 1114 Query or set the internal variable that controls whether internal\n\ |
1115 void | 1115 output from a function is suppressed. If this option is disabled,\n\ |
1116 symbols_of_ov_base (void) | 1116 Octave will display the results produced by evaluating expressions\n\ |
1117 { | 1117 within a function body that are not terminated with a semicolon.\n\ |
1118 DEFVAR (print_answer_id_name, true, print_answer_id_name, | 1118 @end deftypefn") |
1119 "-*- texinfo -*-\n\ | 1119 { |
1120 @defvr {Built-in Variable} print_answer_id_name\n\ | 1120 return SET_INTERNAL_VARIABLE (silent_functions); |
1121 If the value of @code{print_answer_id_name} is nonzero, variable\n\ | |
1122 names are printed along with the result. Otherwise, only the result\n\ | |
1123 values are printed. The default value is 1.\n\ | |
1124 @end defvr"); | |
1125 | |
1126 DEFVAR (silent_functions, false, silent_functions, | |
1127 "-*- texinfo -*-\n\ | |
1128 @defvr {Built-in Variable} silent_functions\n\ | |
1129 If the value of @code{silent_functions} is nonzero, internal output\n\ | |
1130 from a function is suppressed. Otherwise, the results of expressions\n\ | |
1131 within a function body that are not terminated with a semicolon will\n\ | |
1132 have their values printed. The default value is 0.\n\ | |
1133 \n\ | |
1134 For example, if the function\n\ | |
1135 \n\ | |
1136 @example\n\ | |
1137 function f ()\n\ | |
1138 2 + 2\n\ | |
1139 endfunction\n\ | |
1140 @end example\n\ | |
1141 \n\ | |
1142 @noindent\n\ | |
1143 is executed, Octave will either print @samp{ans = 4} or nothing\n\ | |
1144 depending on the value of @code{silent_functions}.\n\ | |
1145 @end defvr"); | |
1146 } | 1121 } |
1147 | 1122 |
1148 /* | 1123 /* |
1149 ;;; Local Variables: *** | 1124 ;;; Local Variables: *** |
1150 ;;; mode: C++ *** | 1125 ;;; mode: C++ *** |