help-octave
[Top][All Lists]
Advanced

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

Re: Tcl&octave: howto get the error message when octave run in a pipe?


From: Stef Pillaert
Subject: Re: Tcl&octave: howto get the error message when octave run in a pipe?
Date: Fri, 16 Mar 2001 08:45:34 +0100

Op do, 15 mrt 2001, schreef Stef Pillaert:
> Hello list,
> I run octave from a GUI written in Tcl, using something like:
> 
> set octaveID [open "|octave -qf" r+]
> puts $octaveID "disp(5*5);"
> gets $octaveID result
> 
> (with the additional flush'es and fileevent's to be a bit more robust...)
> 
> This works fine, but suppose the string I send to octave has 
> octave-syntax-errors, how can I trap the octave-error-message?
>  I think I can detect that there is a octave-syntax-fault because the "gets"
> will return -1 (=didn't read anything), but I don't have acces to the
> error-message this way. I tried something like 
> 
> gets stderr errmessage
> 
> but that doesn't seem to work,...
> 
> Thanks,
> 
> Stef.

(Sorry to reply my own posting)
I realise I can   make advantage of the eval(try,catch) function, but I don't
manage to get the error_text in the catch-part (it is always empty...) Can
someone show me how to use the error_text variable together with eval?

I tried something like:

eval("this_is_false_syntax====!!!!","disp(error_text);");

but this only gives me a blank message...
Thanks for your time,
Stef.



-------------------------------------------------------------
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]