help-octave
[Top][All Lists]
Advanced

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

Re: Redirecting Octave IO


From: Martijn
Subject: Re: Redirecting Octave IO
Date: Fri, 04 Feb 2011 22:01:19 +0100

Hi,
If you insist on doing this, you can try 'expect', which basically
automates typing at the console. I have used it to connect 
to a modem using telnet and it works fine.
However, I suggest you only do this for a niche application. There are
GUI's for octave, especially a number of unfinished ones.

Martijn

On Fri, 2011-02-04 at 16:20 +0000, Richard Crozier wrote:
> Hello,
> 
> I would like to use octave as a child process in a C#.NET application. 
> Basically I'm writing a little gui for octave. I can successfully 
> connect to octave and redirect stdin, stdout and stderr to streams in 
> C#. However, I have a problem that Octave does not always seem to send 
> the prompt to stdout, so I cannot tell if a computation has been completed.
> 
> For instance, if I set the octave prompt to be '>>' and I pass octave a 
> command which results in an output, e.g. 'x = 1\r' where '\r' is the 
> return character of course. I get back the string '>> x = 1'
> 
> However, if I pass in 'x = 1;\r' I get nothing immediately. At the next 
> input of a command that requires output however, I will then get a 
> string of prompts in the output stream.
> 
> e.g.
> 
> sending \r' followed by 'x = 1;r' followed by '\r' followed by 'x = 2\r' 
> will yield nothing in the ouput stream until after the last command when 
> I will get something like: '>> >> >> x = 2'
> 
> Is there any way to force octave to always send the prompts to the 
> output, i.e. replicating what happens when it is run in the normal way?
> 
> I have tried setting 'more off' and calling fflush(stdout) before and 
> after sending command strings but nothing seems to work. The biggest 
> problem is not knowing when octave is finished processing the last command.
> 
> Thanks
> 




reply via email to

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