Menu

#1414 Running load destroys arguments from call

closed-works-for-me
nobody
None
5
2015-03-23
2014-05-29
Anonymous
No

Dear Gnuplot developers,

the following bug has been reported on Debian Bug-Tracker. I would like you to ask to have a look at it [1]:

========================
When running a "call" command with arguments, if the called file runs a "load" command, then the arguments are destroyed.
For example, if there are three files in the current directory:

experiment.plot:
set samples 1000
set pointsize 2.5
call "experiment.plotcall" "1"

experiment.plotcall:
load "experiment.plotload"
set terminal postscript eps monochrome enhanced dashed dashlength 2 22 size 6.6in, 4.45in
set output "experiment.eps"
plot 'flibble$0.out'

experiment.plotload:
<empty file=""></empty>

then the command "gnuplot experiment.plot" is run with version 4.6.4-1~bpo70+1, then the following error message will be given:

"experiment.plotcall", line 6: warning: Skipping unreadable file "flibble.out"
"experiment.plotcall", line 6: No data in plot

whereas with version 4.4.0, the following error message is given:

"experiment.plotcall", line 6: warning: Skipping unreadable file "flibble1.out"
"experiment.plotcall", line 6: No data in plot

Note that the argument "1" has been destroyed. If the "load" command is removed from experiment.plotcall, then the argument is preserved.

Mentioned files are attached.

[1] https://bugs.debian.org/743247

Thank you

Anton

3 Attachments

Discussion

  • AntonG

    AntonG - 2014-05-29

    Sorry for false formatting and not logging-in reporting this bug.

     
  • AntonG

    AntonG - 2014-05-29
     
  • Ethan Merritt

    Ethan Merritt - 2014-05-29

    I can't reproduce this. Here is what I see:

    [1] gnuplot_4.4.0 experiment.plot
    "experiment.plotcall", line 4: warning: Skipping unreadable file "flibble1.out"
    "experiment.plotcall", line 4: No data in plot

    [2] gnuplot_4.6.3 experiment.plot
    "experiment.plotcall", line 4: warning: Skipping unreadable file "flibble1.out"
    "experiment.plotcall", line 4: No data in plot

    [3] gnuplot_4.6.4 experiment.plot
    "experiment.plotcall", line 4: warning: Skipping unreadable file "flibble1.out"
    "experiment.plotcall", line 4: No data in plot

    [4] gnuplot_4.6.5 experiment.plot
    "experiment.plotcall", line 4: warning: Skipping unreadable file "flibble1.out"
    "experiment.plotcall", line 4: No data in plot

    [5] gnuplot_5.0.rc1 experiment.plot
    "experiment.plotcall", line 4: warning: Skipping unreadable file "flibble$0.out"
    "experiment.plotcall", line 4: No data in plot

    I can test more release versions if you like, but based on this set it appears the bug was not in a released version of gnuplot. Perhaps it was introduced locally?

     
    • AntonG

      AntonG - 2014-05-29

      tags 743247 +unreproducible
      thanks

      Hi Ethan,

      you are right, I have just tried it and got also "flibble1.out", sorry
      for possible false alarm.

      Matthew, please confirm whether you still have problems.

      Thanks

      Anton

      2014-05-29 18:37 GMT+02:00 Ethan Merritt sfeam@users.sf.net:

      I can't reproduce this. Here is what I see:

      [1] gnuplot_4.4.0 experiment.plot

      "experiment.plotcall", line 4: warning: Skipping unreadable file
      "flibble1.out"
      "experiment.plotcall", line 4: No data in plot

      [2] gnuplot_4.6.3 experiment.plot

      "experiment.plotcall", line 4: warning: Skipping unreadable file
      "flibble1.out"
      "experiment.plotcall", line 4: No data in plot

      [3] gnuplot_4.6.4 experiment.plot

      "experiment.plotcall", line 4: warning: Skipping unreadable file
      "flibble1.out"
      "experiment.plotcall", line 4: No data in plot

      [4] gnuplot_4.6.5 experiment.plot

      "experiment.plotcall", line 4: warning: Skipping unreadable file
      "flibble1.out"
      "experiment.plotcall", line 4: No data in plot

      [5] gnuplot_5.0.rc1 experiment.plot
      "experiment.plotcall", line 4: warning: Skipping unreadable file
      "flibble$0.out"
      "experiment.plotcall", line 4: No data in plot

      I can test more release versions if you like, but based on this set it
      appears the bug was not in a released version of gnuplot. Perhaps it was
      introduced locally?


       
  • Ethan Merritt

    Ethan Merritt - 2014-05-29

    Hmm. The last part of my comment seems to have been lost.
    The reason 5.0.rc1 prints a different error message is that the argument passing mechanism for "call" commands has been replaced in version 5.

    gnuplot> help call
    
    Subtopics available for call:
        example           old-style
    
     The `call` command is identical to the `load` command with one exception:
     the name of the file being loaded may be followed by up to nine parameters.
    
          call "inputfile" <param-1> <param-2> <param-3> ... <param-9>
    
     Previous versions of gnuplot performed macro-like substitution of the special
     tokens $0, $1, ... $9 with the literal contents of these parameters.
     This mechanism is now deprecated (see `call old-style`).
    
     Gnuplot now provides a set of string variables ARG0, ARG1, ..., ARG9 and an
     integer variable ARGC. When a `call` command is executed ARG0 is set to the
     name of the input file, ARGC is set to the number of parameters present, and
     ARG1 to ARG9 are loaded from the parameters that follow it on the command line.
     Any existing contents of the ARG variables are saved and restored across a
     `call` command.
    
     Because the parameters are stored in ordinary string variables, they may be
     dereferenced by macro expansion (analogous to the old-style deprecated syntax).
     However in many cases it is more natural to use them as you would any other
     variable.
    
     
  • Ethan Merritt

    Ethan Merritt - 2014-05-29
    • status: open --> open-works-for-me
     
  • Ethan Merritt

    Ethan Merritt - 2014-06-11
    • status: open-works-for-me --> closed-works-for-me
     

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.