On Friday 06 February 2009, Petr Mikulik wrote:
> There is a strange error happening with a not-yet-used variable:
>
> gnuplot> load 'bug.gp'
> "bug.gp", line 4: warning: b is not a string variable
>
> where bug.gp:
>
> set macros
> a=''
> if (1) a="plot x"; @a
> if (1) b="plot x*x"; @b
This has always been a limitation on the use of macros.
The substitution is done for each whole line as the line
is read in, before any of the commands on that line have
been executed.
For most purposes, the use of macros has been entirely supplanted
by string variables. In the case above:
if (1) a="plot x"; evaluate(a);
--
Ethan A Merritt
|