Silverfrost Forums

Welcome to our forums

Fortran console

27 Nov 2013 10:00 #13367

I understand that a FORTRAN dll does not provide a console window.

This means, the end user (who uses my 'flib' the FORTRAN object file library/FORTRAN dll) will not be able to see the console and what gets printed onto the console using the 'write' statements in the FORTRAN code.

So, in a case when I want the end user using my object file library of FORTRAN or fortran dll, to see the console window, what is the best way to go about?

27 Nov 2013 4:02 #13372

The following FTN95 program provides output to a Window...

WINAPP
PRINT*, 'Hello World'
END

If you are using ClearWin+ then you can create a 'ClearWin' window for output or, better still, use winio@ with %cw.

27 Nov 2013 6:50 #13373

Should the print be always preceeded by WINAPP?

Because, if there are random print statements in several subroutines, should there be a winapp before each?

Can I use write instead of winapp?

27 Nov 2013 9:08 #13374

WINAPP appears once before the main PROGRAM. Yes you can use WRITE. Details can be found in ftn95.chm.

28 Nov 2013 4:51 #13375

Thank you.

Since my code will also be used with other FOrtran compilers (like Intel Fortran compiler besides silverforst) , will winapp be applicable to other compilers as well?

IS there any other generaic way to get the console window which is applicable to all compilers?

Thanks again

28 Nov 2013 12:59 #13378

PlEase can you advise? Thanks a lot

28 Nov 2013 4:59 #13380

WINAPP will not work with other compilers. I don't know of a generic way to do this.

28 Nov 2013 9:38 #13381

Another option is just with not using 'winapp' at all for compatibility sake. When compiling with FTN95 just add the switch /win which does the same. My disclaimer is that I don't know intimate details of compilation with other compilers

Please login to reply.