- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a console program that uses command line arguments like
app.exe inp1.txt inp2.txt out1.txt out2.bmp
and I use
call GETARG(3,fln1)
call GETARG(4,fln2)
to supply the filenames for the out1.txt and out2.bmp
For reading these input files I have
OPEN(UNIT = 101, FILE = ' ', STATUS = 'OLD', IOSTAT = IERR)
and the File = ' ' takes in inp1.txt and a separate one for inp2.txt
The issue is during debugging (using command arguments) it returns error in opening input file and I have to physically replace it with the filename
OPEN(UNIT = 101, FILE = 'inp1.txt', STATUS = 'OLD', IOSTAT = IERR)
Why is this so. The compiled executable runs fine but during debugging I have to hardcode it in. The reason for the input file name to be different each time is this is run on a webinterface with multiple users possibly running the same application simultaneously and hence each user has a separate input and output filename
Thanks for any help
Sumit
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What I remember from CVF, if I am not mistaken, is that the release version looks after the input file in the application folder (and all folders defined in the PATH variable) but the debug version looks into the upper folder (project folder) first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are relying on a nonstandard feature, which is disabled by default. To enable it, turn on Fortran > Compatibility > PowerStation > Files from Command Line. But why aren't you using the results of GETARG in your OPEN? Or use the standard GET_COMMAND_ARGUMENT.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I converted the inputs to also GETARG commands and that works without having to put on Powerstation compatibility
Thanks

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