- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a fortran program that reads data using read(5,*) statements. I can compile and link it with IVF and can run it from the command line using a command like:
myprog.exe < input_data.txt
Is there some way to do this in Visual Studio? I've tried a few different run options but nothing works. I'm running the 8.1.019 version of IVF and the standard 2003 C++ .net visual studio.
Thanks.
Michael
myprog.exe < input_data.txt
Is there some way to do this in Visual Studio? I've tried a few different run options but nothing works. I'm running the 8.1.019 version of IVF and the standard 2003 C++ .net visual studio.
Thanks.
Michael
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Project Properties.General..Debugging..Command Arguments - put in "< input_data.txt" (no quotes)
Note that the default directory is that of the project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried this and it did not work. I put some getarg statements into the program. When running from Visual Studio getarg picked up
"< input_data.txt" as an argument but the program still hung while waiting for standard input. When running from the command line getarg does not pick up anything put the program does read in the file.
"< input_data.txt" as an argument but the program still hung while waiting for standard input. When running from the command line getarg does not pick up anything put the program does read in the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think Steve's wrong in this regard -- redirection isfeature of the command interpreter (cmd.exe) rather than the process itself.
You need something like:
Executable for debug session:
C:Winntsystem32cmd.exe
Program arguments:
/c D:UsersDujaCodeBrisiDebugTest.exe < Test.txt
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This did work in CVF/VS6. I have not yet tried in in VS.NET - it should be the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, sorry Steve -- it does work indeed.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm not sure how you guys got Steve's suggestion to work. I'm running in Windows XP, service pack 2. That may be making a difference.
But I tried your suggestion, Jugoslav, and that worked (except that I had to substitute WINDOWS for winnt).
Thanks.
Michael
I'm not sure how you guys got Steve's suggestion to work. I'm running in Windows XP, service pack 2. That may be making a difference.
But I tried your suggestion, Jugoslav, and that worked (except that I had to substitute WINDOWS for winnt).
Thanks.
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't get it to work in VS.NET either. Hmm. I will have to research this when I get back to the office (I'm doing training off-site this week.)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page