Menu

#1891 Value of index variable after iteration

None
closed-fixed
nobody
iteration (3)
2017-12-06
2016-12-29
No

Using gnuplot version 5.0.4, the command do for [i=1:3] {}; print i prints "3", whereas current CVS head prints "4". Is that change intended? I did not find anything specified in the docs, so this change does not really qualify as bug.

Discussion

  • Ethan Merritt

    Ethan Merritt - 2016-12-29

    I guess it is a side-effect of this bugfix, but I have not gone back to test that guess.

    2016-10-26 Thomas Sefzick t.sefzick@fz-juelich.de
    * src/plot2d.c: Never decrease value of highest_iteration.
    Avoids missed plots when a plot command contains more than one
    iteration and the last iteration is shorter than the others.
    Bug #1871

     
  • Ethan Merritt

    Ethan Merritt - 2017-02-05

    As of today, in 5.1 the scope of an iteration variable is strictly limited to the iterated clause. Its value after iteration finishes is the same as it was prior to iteration, possibly not defined at all. This is now documented under "help iteration".

    This change does not back-port cleanly to version 5.0 so at least for now the value of the iteration variable after the iteration completes is not guaranteed to be anything in particular in version 5.0.

    See also Bug #1755
    https://sourceforge.net/p/gnuplot/bugs/1755/
    That one may be amenable to the same fix

     

    Last edit: Ethan Merritt 2017-02-06
  • Ethan Merritt

    Ethan Merritt - 2017-02-07
    • status: open --> closed-fixed
    • Group: -->
    • Priority: -->
     
  • Karl Ratzsch

    Karl Ratzsch - 2017-12-06

    This change seems to not have made it into the 5.2 release notes.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.