|
From: Ethan A M. <merritt@u.washington.edu> - 2008-04-08 06:37:05
|
On Monday 07 April 2008 23:14, Ethan A Merritt wrote:
>
> I think the biggest problem with gnuplot's if/else implementation is
> that it is limited to a single line. The following simple construct,
> if it were possible, would make the whole thing a lot more usable:
> if (test) load 'option1'; else load 'option2';
Sorry, I tried to construct a minimal example but that one is too minimal.
As written, it actually does work. The file 'yes' and 'no' contain the
corresponding print statement:
gnuplot> if (1) load 'yes'; else load 'no'
^
warning: ignoring rest of line
Yes
gnuplot> if (0) load 'yes'; else load 'no'
no
But this one fails:
if (test) load 'option1'; print 'A'; \
else load 'option2'; print 'B';
--
Ethan A Merritt
|