help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

diary not saving all output on screen


From: John W. Eaton
Subject: diary not saving all output on screen
Date: Wed, 29 Oct 2003 07:47:13 -0600

On 29-Oct-2003, Ada Cheng <address@hidden> wrote:

| As I am introducing students to Octave/Matlab, I am asking them to
| run simple assignments.m files that I created.  They are suppose to
| save their work using diary and submit those results.  However, with
| students using Octave (I use Octave myself also but I have not use
| the diary commands since my Matlab days) they are having problems
| with diary as not all output on the screen are saved.

| debug> A=rand(3,4)

| Therefore I am missing the two commands A=rand(3,4) and return.  The
| output of rand(3,4) is display but not the actual commands.

This problem should be fixed in future versions of Octave.  If you
really need a fix now, please try the following patch.

Thanks,

jwe


src/ChangeLog

2003-10-29  John W. Eaton  <address@hidden>

        * input.cc (get_user_input): Don't forget about the diary here.


Index: src/input.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/input.cc,v
retrieving revision 1.152
diff -u -r1.152 input.cc
--- src/input.cc        2 Oct 2003 18:33:59 -0000       1.152
+++ src/input.cc        29 Oct 2003 13:40:06 -0000
@@ -548,6 +548,8 @@
 
   flush_octave_stdout ();
 
+  octave_diary << prompt;
+
   std::string input_buf = gnu_readline (prompt.c_str (), true);
 
   if (! input_buf.empty ())
@@ -556,6 +558,11 @@
        command_history::add (input_buf);
 
       size_t len = input_buf.length ();
+
+      octave_diary << input_buf;
+
+      if (input_buf[len - 1] != '\n')
+       octave_diary << "\n";
 
       if (len < 1)
        {



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]