next up previous contents index
Next: Example Up: Commands Previous: Cd   Contents   Index

Call

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 (p. [*])).

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.


Subsections
next up previous contents index
Next: Example Up: Commands Previous: Cd   Contents   Index
2015-07-01