|
From: Nigel N. <nN...@au...> - 2005-06-24 17:19:52
|
Hi Timoth=E9e,
For my gnuplot-as-library driven from wxWidgets, I replaced=0D
bail_to_command_line() with an "extern C" routine that throws=0D
an exception back the C++ caller. Then I wrap calls to the=0D
gnuplot subsystem with try/catch, e.g.,
try {
lib_do_line("set term wx");
lib_do_line("set grid");
lib_do_line("plot sin(x)");
=0D
// execute an arbitrary command string=0D
// generated during a simulation:
lib_do_line( cmd.c_str() );=0D
} catch(...) {
// recover
}
Nigel
----- Original Message -----
> I keep working on the wxwidgets terminal, and I am now=0D
> facing a difficult problem.=0D
>=0D
> When there are errors on a command line, gnuplot uses its=0D
> functions int_error(token, string) to inform the user and=0D
> stop parsing the command line. This function prints an=0D
> error message and then calls bail_to_command_line() which=0D
> is simply a wrapper for the standard longjmp(env) function.=0D
> This is similar to "goto", and puts the program in its=0D
> initial state by restoring the registers set in main().=0D
> --- [snip] ---
___________________________________________________________________________=
__________=0D
This message is intended for the addressee named and may contain=
confidential and=0D
privileged information. If you are not the intended recipient please note=
that=0D
any form of distribution, copying or use of this communication or the=
information=0D
in it is strictly prohibited and may be unlawful. If you receive this=
message in error,=0D
please delete it and notify the sender. =0D
Keep up to date with what's happening in Australian sport. Visit=
www.ausport.gov.au=0D
___________________________________________________________________________=
__________
|