Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!maverick.ksu.ksu.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ark1!nems!dtoa3!jwhite From: jwhite@dtoa3.dt.navy.mil (White) Newsgroups: comp.lang.fortran Subject: Re: Using Data Files in MS Fortran 5.0 Message-ID: <2898@nems.dt.navy.mil> Date: 9 Aug 90 12:55:59 GMT References: <90218.171331TEB106@psuvm.psu.edu> Sender: news@nems.dt.navy.mil Reply-To: jwhite@dtoa3.dt.navy.mil (Joseph White) Organization: David Taylor Research Center, Bethesda, MD Lines: 37 In article <90218.171331TEB106@psuvm.psu.edu> TEB106@psuvm.psu.edu (Tom billet) writes: >Hi, > >I recently purchased the new version of MicroSoft Fortran 5.0. I have never > used any previously version of MicroSoft Fortran and would like to use a data >file in an existing Fortran program. I looked at all the command line >parameters and do not see a way to include a data file. For example, the >previous version of Fortran allows me to type the following command to include >a data file: F fortran program nameoutdata file >The F is the name of the fortran compiler and the rest is just redirection >commands. Is there a similar way in Fortran 5.0? Thanks in advance. > > teb106 If you have Version 5.0, then you all ready have what you need. There are additional procedures that were added to Version 5.0 to read the commandline arguments. The two routines are NARGS() and CALL GETARG (n, buffer, status). They are referanced in section 5.3.3, page 271 of the Reference Manual. Just add these to the beginning of the program, maybe with some code to get the filenames from the user if they are not on the commandline, and your commandline will look something like this: C:\> FortranProgName InFileName OutFileName Another less elegant way to do it is to open the two file with File = '' and use the same commandline. The first unit open is given the InFileName and the second is given the OutFileName, If the user doesnot enter and InFileName or OutFileName the they will be asked for a filename for unit XX. If they didn't write the program then they might not know what unit XX is supposed to be. For info on this method see Page 203 in the same manual. Hope this helps you Joe White jwhite@dtoa3.dt.navy.mil