home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / misc / 5304 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  2.7 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!ira.uka.de!news.belwue.de!news.uni-stuttgart.de!patricia!martin
  2. From: martin@patricia.verfahrenstechnik.uni-stuttgart.de (Martin Hepperle)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: MS-Fortran: filename from cmd line?
  5. Date: 23 Jan 1993 20:16:28 GMT
  6. Organization: Institute A for Mechanics, University of Stuttgart, Germany
  7. Lines: 50
  8. Distribution: world
  9. Message-ID: <1js92sINN6jg@info2.rus.uni-stuttgart.de>
  10. References: <davidw.727655487@auck.irl.cri.nz> <727727885snz@chrism.demon.co.uk>
  11. NNTP-Posting-Host: rusmv1.rus.uni-stuttgart.de
  12.  
  13. In article <727727885snz@chrism.demon.co.uk> chris@chrism.demon.co.uk writes:
  14. >In article <davidw.727655487@auck.irl.cri.nz> davidw@auck.irl.cri.nz writes:
  15. >
  16. >>I recently upgraded to MS-Fortran 5.1, which can generate Windows
  17. >>programs. 
  18. >>
  19. >>I wish to associate the input files for my Fortran simulation with 
  20. >>the Windows .EXE file, AND get the input filename into the 
  21. >>simulation for character manipulation to generate corresponding 
  22. >>output filenames. 
  23. >>
  24. >>Eg, associate *.INP with SIMULATE.EXE. Now I want to be able to
  25. >>double-click on XYZ.INP (in FileManager) to run SIMULATE, opening
  26. >>XYZ.INP as input and generating XYZ.OUT for output. 
  27. >>
  28. >>My local Microsoft support provided information about accessing
  29. >>the PSP or PDB at the start of the app, and a Windows call:
  30. >>GetCurrentPDB(). Before looking into something that seems rather
  31. >>complex to me, has anyone solved this one already?
  32. >>
  33. >
  34. >I've converted quite a number of FORTRAN codes to run under Windows.
  35. >My advice would be to convert your main program to a SUBROUTINE, and
  36. >add a small front end program in C which calls the FORTRAN code. That
  37. >way you can use all the standard C command-line parsing stuff.
  38. But why do you want to make it so complicated ?
  39.  
  40. FORTRAN 5.1 can eccess the command line arguments directly, I have
  41. used it in all my FTN programs: if there are cmd-line options,
  42. they are used, otherwise the user is prompted for filenames etc.
  43.  
  44. There are two functions, discription in the manuals, I am recalling
  45. them from memory here:
  46. INTEGER FUNCTION NARGS() ............ returns number of arguments
  47. INTEGER FUNCTION GETARG(N,STRING) ... returns argument no. N
  48.  
  49. Do I hope this helps ?
  50.  
  51. Martin.
  52. ________________________________________________________
  53.  
  54.       Martin J. Hepperle          MMMMMMMMMMMMH   HHH
  55.      Universitaet Stuttgart       M   MMM   MMH   HHH
  56.        Pfaffenwaldring 9          M   MMM   MMHHHHHHH
  57.      D-7000 Stuttgart 80          M   MMM   MMH   HHH
  58.  Germany, Europe, World, Universe M   MMM   MMH   HHH
  59.      PLEASE USE THIS RETURN ADDRESS ONLY:
  60.     martin@mecha2.verfahrenstechnik.uni-stuttgart.de
  61. ________________________________________________________
  62.