MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Saving

  • To: mathgroup at smc.vnet.net
  • Subject: [mg21748] Re: Saving
  • From: Harald Giese <giese at dkrz.de>
  • Date: Thu, 27 Jan 2000 22:56:30 -0500 (EST)
  • Organization: Institut fuer Meereskunde, Universitaet Hamburg
  • References: <86mdn7$2ei@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Robert wrote:
> 
> hello!
> how can i create a file name in a variable in a program to save results?
> 
> For example,
> 
> result=1
> filename= SequenceForm["test", i, ".asc"] /. {i -> 1}
> Put[result, filename]
> 
> gives the output:
> 
> General::stream: test1.asc is not a string, InputStream[ ], or
> OutputStream[ ].

The reason fo this behaviour is, that "filename" is of type
"SequenceForm" not "String":
In[]:= Head[filename]
Out[]= SequenceForm

Convert it using "ToString"
In[]:= filename = ToString[filename];
Now all is fine:
In[]:= Head[filename]
Out[]= String

> 
> by the way, is there a way to save (all) variables with name and current
> content?

Have a look at "Save" in the online help.

Regards,
Harald


--- This message was entirely written using recycled electrons ---

Harald Giese
Email: giese at dkrz.de
Phone: +49 (0)40 42838 5796; Fax: +49 (0)40 5605724
Institut fuer Meereskunde der Universitaet Hamburg
(Institute of Oceanography of the University of Hamburg)
Troplowitzstrasse 7, D-22529 Hamburg


  • Prev by Date: Sturm-Liouville Problem (differential equation eigenvalue problem)
  • Next by Date: Re: Bessel J0 zeros
  • Previous by thread: Re: Saving
  • Next by thread: Q: Getting directory of notebook