Go to the first, previous, next, last section, table of contents.


2.2 call

The section 2.2 call command is identical to the load command with one exception: you can have up to ten additional parameters to the command (delimited according to the standard parser rules) which can be substituted into the lines read from the file. As each line is read from the section 2.2 called input file, it is scanned for the sequence `$` (dollar-sign) followed by a digit (0--9). If found, the sequence is replaced by the corresponding parameter from the section 2.2 call command line. If the parameter was specified as a string in the section 2.2 call line, it is substituted without its enclosing quotes. `$` followed by any character other than a digit will be that character. E.g. use `$$` to get a single `$`. Providing more than ten parameters on the section 2.2 call command line will cause an error. A parameter that was not provided substitutes as nothing. Files being section 2.2 called may themselves contain section 2.2 call or section 2.8 load commands.

The section 2.2 call command _must_ be the last command on a multi-command line.

Syntax:

      call "<input-file>" <parameter-0> <parm-1> ... <parm-9>

The name of the input file must be enclosed in quotes, and it is recommended that parameters are similarly enclosed in quotes (future versions of gnuplot may treat quoted and unquoted arguments differently).

Example:

If the file 'calltest.gp' contains the line:

      print "p0=$0 p1=$1 p2=$2 p3=$3 p4=$4 p5=$5 p6=$6 p7=x$7x"

entering the command:

      call 'calltest.gp' "abcd" 1.2 + "'quoted'" -- "$2"

will display:

      p0=abcd p1=1.2 p2=+ p3='quoted' p4=- p5=- p6=$2 p7=xx

NOTE: there is a clash in syntax with the datafile section 2.10.1.7 using callback operator. Use `$$n` or `column(n)` to access column n from a datafile inside a section 2.2 called datafile plot.


Go to the first, previous, next, last section, table of contents.