|
From: <pl...@pi...> - 2012-01-31 17:18:45
|
Hi,
I have a number of gnuplot scripts that have various options set. I
would like to set a default value in the script and optionally determine
the value from the calling script or command.
This does not seem to be possible.
eg.
if (doPNG) { set terminal png; set output pngfile}
else { set terminal wxt }
plot ....
called as :
(echo 'doPNG=1;' && cat cos_fit.gnu) | gnuplot
Some kind of isdefined() function would be a solution or simply if the
interpreter could return some kind of NaN value that could then be
tested instead of triggering an error and breaking out.
Alternatively kind of error trapping mechanism but that may be going
beyond what is needed for this simple test.
Do you think this would be a useful feature?
Regards,. Peter.
|