- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I'm looking for a way to have a Fortran pgm write to Visual Studio's output window.
I can do so now using the subroutine `OutputDebugString` in library `IFWINA`.
Is there a simpler way to do this? I have tried `WRITE(*, format)`, but this doesn't produce anything in Visual Studio's output window.
Visual Studio 2022 (17.6.0), Intel Fortran compiler 2023.0.0, Windows 11.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
OutputDebugStringA is - from what I recall - what Microsoft itself recommends:
https://learn.microsoft.com/en-us/windows/win32/api/debugapi/nf-debugapi-outputdebugstringa
How much simpler can it get once you realize the Fortran language has no business recognizing anything like the Visual Studio output window?
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
OutputDebugStringA is - from what I recall - what Microsoft itself recommends:
https://learn.microsoft.com/en-us/windows/win32/api/debugapi/nf-debugapi-outputdebugstringa
How much simpler can it get once you realize the Fortran language has no business recognizing anything like the Visual Studio output window?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I had a small chuckle at your comment. The debug window is useful for looking at information that you do not want on the main screen as your program progresses, Fortran is there to do the formula translation, the rest is just fluff to get the data in and the results out.
It is nice when you have a program that generates 0.5 million FE bricks tell you on a different screen that brick 15 is now working when it has not been since last night. Of course I do not use the debug screen in Fortran, just the main console, but it is a god send in C#.
O! for the days of Fortran II and a good PDP, we could all go back to a simpler life, no facebook, no windows and no C# or Python.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I just route all print output by default to the output window by starting an "external tool" that consists of the following batch file
@Echo off
SETLOCAL
set SAVESTAMP=%DATE:~4%
set SAVESTAMP=%SAVESTAMP:/=-%@%TIME::=-%
set SAVESTAMP=c:\mfortran\output%SAVESTAMP: =%.txt
%1\x64\Release\mfortran.exe | mtee.exe %SAVESTAMP%
with the "$(ProjectDir)" as argument and the "Use Output Window" option checked. I this way, the output appears within the IDE (no console window), and I have a copy of the text output in a txt file that I can inspect later or during a run with another text editor.

- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable