Thread View: comp.os.ms-windows.programmer.misc
4 messages
4 total messages
Started by David White
Thu, 21 Jan 1993 22:31
MS-Fortran: filename from cmd line?
Author: David White
Date: Thu, 21 Jan 1993 22:31
Date: Thu, 21 Jan 1993 22:31
22 lines
1385 bytes
1385 bytes
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? david white davidw@auck.irl.cri.nz -- david white (engineer, Goon fan & son of my Dad) Internet davidw@auck.irl.cri.nz Fax +64 9 443-4737
Re: MS-Fortran: filename from cmd line?
Author: Chris Marriott
Date: Fri, 22 Jan 1993 18:38
Date: Fri, 22 Jan 1993 18:38
42 lines
2281 bytes
2281 bytes
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? > >david white davidw@auck.irl.cri.nz > >-- > david white (engineer, Goon fan & son of my Dad) > Internet davidw@auck.irl.cri.nz Fax +64 9 443-4737 > 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. Best wishes, Chris -- -------------------------------------------------------------------------- | Chris Marriott | chris@chrism.demon.co.uk | | Warrington, UK | BIX: cmarriott | | | CIX: cmarriott | | Save the whales. Collect the whole set. | CompuServe: 100113,1140 | --------------------------------------------------------------------------
SOLVED! (Was: MS-Fortran: filename from cmd line?)
Author: David White
Date: Sat, 23 Jan 1993 09:47
Date: Sat, 23 Jan 1993 09:47
37 lines
2208 bytes
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
Re: MS-Fortran: filename from cmd line?
Author: Martin Hepperle
Date: Sat, 23 Jan 1993 20:16
Date: Sat, 23 Jan 1993 20:16
50 lines
2819 bytes
2819 bytes
In article <727727885snz@chrism.demon.co.uk> chris@chrism.demon.co.uk 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.
>
But why do you want to make it so complicated ?
FORTRAN 5.1 can eccess the command line arguments directly, I have
used it in all my FTN programs: if there are cmd-line options,
they are used, otherwise the user is prompted for filenames etc.
There are two functions, discription in the manuals, I am recalling
them from memory here:
INTEGER FUNCTION NARGS() ............ returns number of arguments
INTEGER FUNCTION GETARG(N,STRING) ... returns argument no. N
Do I hope this helps ?
Martin.
________________________________________________________
Martin J. Hepperle MMMMMMMMMMMMH HHH
Universitaet Stuttgart M MMM MMH HHH
Pfaffenwaldring 9 M MMM MMHHHHHHH
D-7000 Stuttgart 80 M MMM MMH HHH
Germany, Europe, World, Universe M MMM MMH HHH
PLEASE USE THIS RETURN ADDRESS ONLY:
martin@mecha2.verfahrenstechnik.uni-stuttgart.de
________________________________________________________
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads