|
From: Ethan A M. <sf...@us...> - 2012-05-02 21:16:12
|
On Monday, April 30, 2012 03:21:36 pm Arun Persaud wrote:
> Hi
>
> I just ran across the following problem:
>
> do for [i=5:1] {
> print i
> }
>
> prints "5" instead of doing nothing. Is this the intended behavior?
>
> This seems due to the use of a "do {} while" structure in
> src/command.c:do_command, instead of perhaps a while or for.
>
> Other places in gnuplot where "for" is used, don't seem to do this:
>
> plot for [i=5:1] sin(i*x)
set for [i=5:1] label i "Foo"
show label
label 5 "Foo" at (0, 0, 0) left not rotated back nopoint
So yes, there is an inconsistency. There are currently three "for"
constructs
do for
set for
plot for
The first two of these always iterate at least once; the third one does not.
The documentation is silent on the intended behavior.
So which to change, "plot for" or both the others?
|