🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2283

SOLVED! (Was: MS-Fortran: filename from cmd line?)

#2283
From: David White
Date: Sat, 23 Jan 1993 09:47
37 lines
2208 bytes
In <727727885snz@chrism.demon.co.uk> chris@chrism.demon.co.uk (Chris Marriott) writes:

>In article <davidw.727655487@auck.irl.cri.nz> davidw@auck.irl.cri.nz writes:

>>I recently upgraded to MS-Fortran 5.1, which can generate Windows
>>programs. 
>>
>>I wish to associate the input files for my Fortran simulation with 
>>the Windows .EXE file, AND get the input filename into the 
>>simulation for character manipulation to generate corresponding 
>>output filenames. 
>>
>>Eg, associate *.INP with SIMULATE.EXE. Now I want to be able to
>>double-click on XYZ.INP (in FileManager) to run SIMULATE, opening
>>XYZ.INP as input and generating XYZ.OUT for output. 
>>
>>My local Microsoft support provided information about accessing
>>the PSP or PDB at the start of the app, and a Windows call:
>>GetCurrentPDB(). Before looking into something that seems rather
>>complex to me, has anyone solved this one already?

>I've converted quite a number of FORTRAN codes to run under Windows.
>My advice would be to convert your main program to a SUBROUTINE, and
>add a small front end program in C which calls the FORTRAN code. That
>way you can use all the standard C command-line parsing stuff.

In case anyone else was wondering what the simple answer was... Even
after trying to RTFM, and try local MS-Support... it was in the manual!
(Shows how bad the index is.) There is a function called GETARG in 
MS-Fortran to do it. No need for anything fancy or tricky.

Thanks to bongo@dialix.oz.au ?? from the Univ of Western Australia for 
the pointer.

--
 david white    (engineer, Goon fan & son of my Dad)
 Internet davidw@auck.irl.cri.nz  Fax +64 9 443-4737
Technical Details
Message-ID: <davidw.727782469@auck.irl.cri.nz>
Path: arc1-ca.pugleaf.net!sparky!uunet!comp.vuw.ac.nz!zephyr.grace.cri.nz!totara.auck.irl.cri.nz!davidw
References: <davidw.727655487@auck.irl.cri.nz> <727727885snz@chrism.demon.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!comp.vuw.ac.nz!zephyr.grace.cri.nz!totara.auck.irl.cri.nz!davidw
From: davidw@auck.irl.cri.nz (David White)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: SOLVED! (Was: MS-Fortran: filename from cmd line?)
Date: 23 Jan 93 09:47:49 GMT
Organization: Industrial Research Ltd, Auckland, New Zealand
Lines: 37
Message-ID: <davidw.727782469@auck.irl.cri.nz>
References: <davidw.727655487@auck.irl.cri.nz> <727727885snz@chrism.demon.co.uk>
NNTP-Posting-Host: totara.auck.irl.cri.nz