|
From: sfeam (E. Merritt) <eam...@gm...> - 2010-02-14 19:54:32
|
On Sunday 14 February 2010, Hans-Bernhard Bröker wrote: > > On Friday 12 February 2010 11:26:36 Teo S Bernhard wrote: > > >>>> the below shortened example reproducing the error message: > >>>> > >>>> > >>>> # file: trial.gpl > >>>> f(x)=x > >>>> plot a=1, \ > >>>> f(x)*a title "data from index a=1" w l lw 2 lt a , a=a+1, \ > >>>> f(x)*a title "data from index a=2" w l lw 2 lt a , a=a+1, \ > >>>> a=0 > > I see no particularly compelling reason why this can't be changed to > > a=0 ; plot \ > f(x)*a title "data from index a=1" w l lw 2 lt a , a=a+1, \ > f(x)*a title "data from index a=2" w l lw 2 lt a ; a = 0 > > Note the semicolons. The problem is that the two forms do not produce the same result. See Bug #2907028. If you place the "a=0" inside the plot statement, then a really is 0 during the first function evaluation. If you place the "a=0" before the plot statement, separated by a semicolon, then a has the value 1 during the first function evaluation. This is, to say the least, unexpected. |