help-octave
[Top][All Lists]
Advanced

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

Re: Sync with external program


From: Kim Rydhof Thor Hansen
Subject: Re: Sync with external program
Date: Fri, 21 Jun 2013 08:15:07 +0200

Hi Richard

On Thu, Jun 20, 2013 at 12:52 PM, Richard KIrk <address@hidden> wrote:
>
...
> We could improve on this if we could tell whether octave is busy. I cannot
> see any easy way of doing this in 'echoFile' as octave takes stuff from its
> input even when it is executing code. The only thing I can see is to stick
> something within 'octave' itself, so it only read the files when you were
> not typing and it is not busy.
>
> The following code is given without any restriction on copyright. Hack as
> you please. If you have any cunning suggestions, please post them on this
> thread.

I faced the same problem when writing JavaOctave, and also the problem
of handling syntax errors without losing the running octave process.
The solution for me was to store all commands in strings and then eval
those strings with a catch statement in eval to capture errors. The
cost of using this method is that you can't eval half done stuff and
then finish it later, you have to evaluate whole statements like
entire functions, for our use this was not a problem.

Regards,
-- 
Kim Rydhof Thor Hansen
Vadgårdsvej 3, 2. tv.
2860 Søborg
Phone: +45 3091 2437


reply via email to

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