|
From: <pl...@pi...> - 2012-02-08 19:46:45
|
HI,
unless I'm reading it wrongly or it simply unclear , it seems that exit
is not doing what it says on the box.
I have a test file:
test_val=0
if (test_val != 1) {print "*** an error was found ; exit without
plotting sine ***" ; exit; print "end of if"}
plot sin(x);
print "no errors, sine was plotted";
when I load this from gnuplot DO get the plot of sine and the following
output :
gnuplot> load "test.gnu"
*** an error was found ; exit without plotting sine ***
no errors, sine was plotted
gnuplot>
help exit :
>>
The commands `exit` and `quit`, as well as the END-OF-FILE character
(usually
Ctrl-D) terminate input from the current input stream: terminal
session, pipe,
and file input (pipe).
If input streams are nested (inherited `load` scripts), then reading will
continue in the parent stream.
>>
From this I was expecting exit to exit from the loaded script and
return me to the gnuplot prompt.
Instead only seems to have exited from the if block.
Does the doc need clarifying or is this an unintended consequence of the
new blocked if structures?
regards, Peter.
|