Mercurial > octave-nkf
comparison src/input.cc @ 4233:ccfdb55c8156
[project @ 2002-12-20 22:43:54 by jwe]
author | jwe |
---|---|
date | Fri, 20 Dec 2002 22:43:55 +0000 |
parents | e96f52432059 |
children | c3acf8a967fa |
comparison
equal
deleted
inserted
replaced
4232:b032ebd54586 | 4233:ccfdb55c8156 |
---|---|
563 if (len < 1) | 563 if (len < 1) |
564 { | 564 { |
565 if (debug) | 565 if (debug) |
566 goto again; | 566 goto again; |
567 else | 567 else |
568 { | 568 return read_as_string ? octave_value ("") : octave_value (Matrix ()); |
569 if (read_as_string) | |
570 return ""; | |
571 else | |
572 return Matrix (); | |
573 } | |
574 } | 569 } |
575 | 570 |
576 if (debug) | 571 if (debug) |
577 { | 572 { |
578 if (match_sans_spaces_semi ("exit", input_buf) | 573 if (match_sans_spaces_semi ("exit", input_buf) |
717 | 712 |
718 unwind_protect_bool (Vsaving_history); | 713 unwind_protect_bool (Vsaving_history); |
719 | 714 |
720 Vsaving_history = true; | 715 Vsaving_history = true; |
721 | 716 |
722 retval = get_user_input (args, true, 0); | 717 octave_value_list tmp = get_user_input (args, true, 0); |
718 | |
719 retval = tmp(0); | |
723 | 720 |
724 unwind_protect::run_frame ("do_keyboard"); | 721 unwind_protect::run_frame ("do_keyboard"); |
725 | 722 |
726 return retval; | 723 return retval; |
727 } | 724 } |
793 { | 790 { |
794 case 1: | 791 case 1: |
795 { | 792 { |
796 if ((Vecho_executing_commands & ECHO_SCRIPTS) | 793 if ((Vecho_executing_commands & ECHO_SCRIPTS) |
797 || (Vecho_executing_commands & ECHO_FUNCTIONS)) | 794 || (Vecho_executing_commands & ECHO_FUNCTIONS)) |
798 bind_builtin_variable ("echo_executing_commands", | 795 bind_builtin_variable ("echo_executing_commands", ECHO_OFF); |
799 static_cast<double> (ECHO_OFF)); | |
800 else | 796 else |
801 bind_builtin_variable ("echo_executing_commands", | 797 bind_builtin_variable ("echo_executing_commands", ECHO_SCRIPTS); |
802 static_cast<double> (ECHO_SCRIPTS)); | |
803 } | 798 } |
804 break; | 799 break; |
805 | 800 |
806 case 2: | 801 case 2: |
807 { | 802 { |
808 std::string arg = argv[1]; | 803 std::string arg = argv[1]; |
809 | 804 |
810 if (arg == "on") | 805 if (arg == "on") |
811 bind_builtin_variable ("echo_executing_commands", | 806 bind_builtin_variable ("echo_executing_commands", ECHO_SCRIPTS); |
812 static_cast<double> (ECHO_SCRIPTS)); | |
813 else if (arg == "off") | 807 else if (arg == "off") |
814 bind_builtin_variable ("echo_executing_commands", | 808 bind_builtin_variable ("echo_executing_commands", ECHO_OFF); |
815 static_cast<double> (ECHO_OFF)); | |
816 else | 809 else |
817 print_usage ("echo"); | 810 print_usage ("echo"); |
818 } | 811 } |
819 break; | 812 break; |
820 | 813 |
823 std::string arg = argv[1]; | 816 std::string arg = argv[1]; |
824 | 817 |
825 if (arg == "on" && argv[2] == "all") | 818 if (arg == "on" && argv[2] == "all") |
826 { | 819 { |
827 int tmp = (ECHO_SCRIPTS | ECHO_FUNCTIONS); | 820 int tmp = (ECHO_SCRIPTS | ECHO_FUNCTIONS); |
828 bind_builtin_variable ("echo_executing_commands", | 821 bind_builtin_variable ("echo_executing_commands", tmp); |
829 static_cast<double> (tmp)); | |
830 } | 822 } |
831 else if (arg == "off" && argv[2] == "all") | 823 else if (arg == "off" && argv[2] == "all") |
832 bind_builtin_variable ("echo_executing_commands", | 824 bind_builtin_variable ("echo_executing_commands", ECHO_OFF); |
833 static_cast<double> (ECHO_OFF)); | |
834 else | 825 else |
835 print_usage ("echo"); | 826 print_usage ("echo"); |
836 } | 827 } |
837 break; | 828 break; |
838 | 829 |
1129 The value of @code{completion_append_char} is used as the character to\n\ | 1120 The value of @code{completion_append_char} is used as the character to\n\ |
1130 append to successful command-line completion attempts. The default\n\ | 1121 append to successful command-line completion attempts. The default\n\ |
1131 value is @code{\" \"} (a single space).\n\ | 1122 value is @code{\" \"} (a single space).\n\ |
1132 @end defvr"); | 1123 @end defvr"); |
1133 | 1124 |
1134 DEFVAR (echo_executing_commands, static_cast<double> (ECHO_OFF), | 1125 DEFVAR (echo_executing_commands, ECHO_OFF, echo_executing_commands, |
1135 echo_executing_commands, | |
1136 "-*- texinfo -*-\n\ | 1126 "-*- texinfo -*-\n\ |
1137 @defvr {Built-in Variable} echo_executing_commands\n\ | 1127 @defvr {Built-in Variable} echo_executing_commands\n\ |
1138 This variable may also be used to control the echo state. It may be\n\ | 1128 This variable may also be used to control the echo state. It may be\n\ |
1139 the sum of the following values:\n\ | 1129 the sum of the following values:\n\ |
1140 \n\ | 1130 \n\ |