Newbie Question: String variable type and filename



"Christiansson, G.A.V." <g.a.v.christiansson@wbmt.tudelft.nl> writes:

> I want to set the filename as a string variable, and use it in the
> subsequent calls to the "tex" function, like this:
>
> outputfile: string("D:\\docs\\maxima\\somefile.tex")$
> tex(" -- Some Output -- ", outputfile)$
>
> I have also tried:
> outputfile: "D:\\docs\\maxima\\somefile.tex"$
>
> But I get no output in the specified tex file. 

Try

outputfile:"foo404.tex";
tex(%pi,''outputfile);

Cf. `Introduction to Command Line' in the manual; as Stavros pointed
out, TEX's second argument is not evaluated otherwise.

Another solution would be to use an alias (this works because maxima
strings are really symbols, internally)

alias(outputfile,"foo404.tex");
tex(%pi,outputfile);

However, before switching to another output file you have to

remove(outputfile,alias);

Wolfgang