From: ivana r. <iva...@mf...> - 2016-12-18 17:30:00
|
Hi all, reading the gnuplot manual I'd guess that the call arguments would be passed as are but they are numerically expanded and split before being transferred to strings ARG0..ARG9 if they are not strings themselves. (This not occures for ``gnuplot -c <script> ARGS''.) with: # cat show_arguments.gplot print "ARGn=\"value\" #strlen(value)" print "ARGC=", ARGC do for [n=0:ARGC] { print what="ARG".n, "=\"", val = value(what), "\" #", strlen(val) } --------------------------------------- I get: # (1) # gnuplot -d -e 'call "show_arguments.gplot" ar1 2ar' ARGn="value" #strlen(value) ARGC=3 ARG0="show_arguments.gplot" #20 ARG1="ar1" #3 ARG2="2" #1 ARG3="ar" #2 --------------------------------------- i.e., the same as for # gnuplot -d -e 'call "show_arguments.gplot" ar1 2 ar' --------------------------------------- # (2) # gnuplot -d -e 'call "show_arguments.gplot" et1 2et 4et' call "show_arguments.gplot" et1 2et 4et ^ line 0: expecting exponent --------------------------------------- also, call command accept just one more argument than it can: # gnuplot -d -e 'call "show_arguments.gplot" 1 2 3 4 5 6 7 8 9 10' ARGn="value" #strlen(value) ARGC=10 ARG0="show_arguments.gplot" #20 ARG1="1" #1 ARG2="2" #1 ARG3="3" #1 ARG4="4" #1 ARG5="5" #1 ARG6="6" #1 ARG7="7" #1 ARG8="8" #1 ARG9="9" #1 ARG10="NaN" #line 11: internal error : strlen of non-STRING argument --------------------------------------- # gnuplot -d -e 'call "show_arguments.gplot" 1 2 3 4 5 6 7 8 9 10 11' call "show_arguments.gplot" 1 2 3 4 5 6 7 8 9 10 11 ^ "show_arguments.gplot", line 0: too many arguments for 'call <file>' --------------------------------------- (tested on Linux deimos 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3 (2015-04-23) x86_64 GNU/Linux gnuplot Version 5.0 patchlevel 5 last modified 2016-10-02 ) sincerely Iva |