home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math.symbolic
- Path: sparky!uunet!stanford.edu!agate!boulder!sherod
- From: sherod@newton.Colorado.EDU (Scott Herod)
- Subject: Re: Mathematica - Output-Filename
- Message-ID: <1992Aug20.032011.17743@colorado.edu>
- Sender: news@colorado.edu (The Daily Planet)
- Nntp-Posting-Host: newton.colorado.edu
- Organization: University of Colorado, Boulder
- References: <Bt9FCB.KGn@watserv1.uwaterloo.ca>
- Date: Thu, 20 Aug 1992 03:20:11 GMT
- Lines: 36
-
- In article <Bt9FCB.KGn@watserv1.uwaterloo.ca> mrs@.waterloo.edu (M. R. Sridhar) writes:
- >
- >stream = OpenWrite["filename", FormatType->OutputForm];
- >Write[stream, XX, " ", YY];
- >Close[stream];
- >
- >In the above set of statements how do i make the output filename independent
- >of the program? i.e. i would like to specify the output filename before
- >these statements are executed.
- >
- >Thanks in advance.
- >
- >Sridhar.
- >
-
- In your example "filename" is a string so any one will do. You can even
- create the name interactively by
-
- file = InputString["What file do you want to create?" ];
-
- Alternately you could send string as a function argument.
-
- dowrite[str_] :=
- Block[{stream},
- stream := OpenWrite[strn,....];
- .
- .
- ]
-
- Hope something like this helps. Feel free to send me mail if you have
- a question.
-
- Scott Herod
- Applied Mathematics
- University of Colorado, Boulder
- (sherod@newton.colorado.edu)
-