Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

controlling the console

georgeg
Beginner
531 Views
Hi, I have a running Fortran program that does lots of console output.

But I'd really like it to be run from inside a Perl script and have the output returned to Perl.
No problem , one just writes: $Out = `FortProg.Exe`;

But we get the Fortran console window popping up, which breaks the illusion that this is just one integrated program.

Is there some way to not have the Fortran program open up a console window?
0 Kudos
3 Replies
Steven_L_Intel1
Employee
531 Views
I'm puzzled - if you are somehow redirecting or piping the output of the Fortran program to the Perl script, there should not be a console window. If there is, I doubt you are getting the output.

You can create a program with no console window by making it a "Windows application" with a WinMain entry point. But then you could not do console output. You could write to "standard output" which, if your script does it right, should be something it intercepts and reads.
0 Kudos
jimdempseyatthecove
Honored Contributor III
531 Views

>> You can create a program with no console window by making it a "Windows application" with a WinMain entry point.

And you can add a command line option (-NoConsoleWindow) that if not present you make a call to AllocConsole() to create the console window. Then in your Pearl script add the -NoConsoleWindow option. (or -Quiet)

Jim Dempsey

0 Kudos
g_f_thomas
Beginner
531 Views

Also, with AllocConsole you can choose to hide or display the console as you see fit once you determine the console's handle. This has been discuss several times on this forum and a (first) recourse to 'Search' should haul in previous posts dealing with the same issue.

This allows you to have legitimate write(*,*), print *, pause, etc. in Fortran code for old style debugging. The console functions like VB6's intermediate window to which one posts Debug.Print, the outcomes of Debug.Asserts, etc in debug mode but they are not displayed at run time even though the statements are retained in the code ready for the next round of debugging.

Gerry

OT

Does this BB rununder .Net? Lately it seems to me to being sluggish and hesitant in its performance.

0 Kudos
Reply