- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you need the filename, use NARGS to get the number of command line arguments and use GETARG to access the filename from the command line. Then you can parse the filename and go on from there. With the use of GETARG programmed in, you will also be able to drag-and -drop a filename onto a shortcut to your application and start it that way. You can also associate your application with several filename extensions in Explorer (see Tools..Folder Options..File Types from the Explorer menu bar),then double-clicking on a filename with one of the extensions will start you application with the filename as the first argument after the application's name. From the FORTRAN Help:
GETARG Run-Time Subroutine: Returns the specified command-line argument (where the command itself is argument number 0).
Module: USE DFLIB
Syntax CALL GETARG (n, buffer [, status])
n (Input) INTEGER(2). Position of the command-line argument to retrieve. The command itself is argument number 0.
buffer (Output) Character*(*). Command-line argument retrieved.
status (Optional; output) INTEGER(2). If specified, returns the c completion status. If there were no errors, status returns the number of characters in the retrieved command-line argument before truncation or blank-padding. (That is, status is the original number of characters in the command-line argument.) Errors return a value of -1. Errors include specifying an argument position less than 0 or greater than the value returned by NARGS. GETARG can be used with two or three arguments. If you use module DFLIB.F90 in the DF98INCLUDE subdirectory (by including the statement USE DFLIB), you can mix calls to GETARG with two or three arguments. If you do not use DFLIB.F90, you can use either two-argument or three-argument calls to GETARG but only one type of call within a subprogram. GETARG returns command-line arguments as they were entered. There is no case conversion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your help, it works just fine!
Regards,
Lars

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page