Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
using the CALL instruction gives problems: $0 contains the called script's name instead of the first parameter to the script!
so scripts as of 4.4.4 don't work any more...
PS: the scripts in use were nested; tested with WindowsXP
Can anyone confirm this on Windows?
I cannot reproduce it here under linux or using the windows executable running under wine. The call parameters are reported equivalently by gnuplot versions going back as far as 4.0 and including current CVS.
Are you sure you are seeing the effect of $0 substitution done by gnuplot rather than being done by a command shell? This really sounds like a shell issue.
Working just fine here (WIn 7, using the official Win32 binaries of both 4.4.4 and 4.6, both console and GUI versions tested).
So, to the OP: you'll have to extract a self-contained test case for this problem.
Sample for the problem call DOIT.CMD
I have uploaded a sample showing, that $0 contains the skript name of the CALL-statement instead of the first parameter to the skript file. Just start doit.cmd and look at the error message. If you use 4.4.4 it works (...ok you would need the data files as well, but as a proof of the bug it should do)
1) Your test script cannot work as provided, because it contains a typo in the called file name (NotenLaufbahn_avg_fit_fitAFile.plt.inc instead of NotenLaufbahn_avg_fit_fitAfile.plt.inc)
2) After correcting that typo, the script still does not run because there is a missing data file.
3) Please show us the output from running the scripts (after fixing) through 4.4 and 4.6.
This is far too complicated a test case anyhow. Just run a simple test using two files
print "$$0 = $0"; print "$$1 = $1"; print "$$2 = $2"
call 'file1.gp' Zero One Two
$ gnuplot_4.6 file0.gp
$0 = Zero
$1 = One
$2 = Two
OK. I think I have figured out the problem your scripts are hitting.
In gnuplot 4.4, the parameters $0 $1 etc were preserved across a "call" to another script.
In version 4.6, the parameters are not preserved. More precisely, the parameters themselves may be preserved, but the _number_ of active parameters is over-written by each new "call" execution. So when one of your scripts (that was itself called with 2 parameters) calls another with zero parameters, after return the first script now acts as if there are still zero parameters. That is, it loses track of the 2 parameters present when it was first entered.
So yes there is a bug that affects your scripts. I will look into a proper fix.
Meanwhile, several work-arounds are possible, although I have not tested extensively. The simplest is to stuff some junk parameters at the end of the existing call that has zero parameters. The lower level script being called will ignore them, but the upper level script doing the calling will not see its own number of parameters reset to zero.
- call 'NotenLaufbahn_avg_fit_start_plt.inc'
+ call 'NotenLaufbahn_avg_fit_start_plt.inc' dummy1 dummy2 dummy3 dummy4