Adam <adammaj1 at o2.pl> writes:
> Hi,
>
> Thx for an answer.
>
>> What do you want do do with load_pathname in a batch file?
>
> I want to save the output ( graphic) file in the same directory as
> batch file.
> For example :
>
> draw2d(file_name = concat(path,name),
>
> Now Maxima saves it to my home directory ( linux).
> I can write path by hand, but maybe there is a clever method.
Ok, but this seems really weird to me. I mean, I tend to save all the
Maxima scripts that I write in a directory called ~/scripts/maxima. If
they generate output, there's no reason that I'd want it generated in
that directory!
Maxima is probably saving things in the current directory, which I
expect will default to the home directory if you run it from a shortcut
in a GUI (eg desktop icon etc.)
Looking quickly through the manual, I couldn't see a way to change the
current working directory in the Maxima language. Is that something you
would use?
>>It seems load_pathname is working as documented:
> ....
> and : "batch has no return value. "
> You are right.
> What is the reason for this behaviour ?
The batch() function goes through a file and executes each statement in
it. I don't think it was designed with "Call this file as a function" in
mind, which is presumably how you're thinking about it. As such, the
batch() function doesn't return anything relating to the computation
that was performed.
If you're trying to make "a function that runs and returns a value", I
would suggest you use load() to load the definitions from some file,
then call the function that has been loaded into the Maxima image.
Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20121030/69dad348/attachment.pgp>