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

Changing Console properties from VCF

tazmania23
Einsteiger
770Aufrufe
Hi Everyone,
I want to change the properties of the console window within the Fortran code. Basically, I want the text to be displayed in black color and the background in white.
--TaZ
0 Kudos
2 Antworten
Jugoslav_Dujic
Geschätzter Beitragender II
770Aufrufe

Try:

use DFWIN

integer:: hConsole, b

hConsole = GetStdHandle(STD_OUTPUT_HANDLE)
b = SetConsoleTextAttribute(hConsole, &
BACKGROUND_RED+ BACKGROUND_GREEN+ BACKGROUND_BLUE )

Gary Scottis developing a library of wrappers for console-manipulation functions. Check out http://www.fortranlib.com/ezann.html.
Jugoslav
tazmania23
Einsteiger
770Aufrufe

Thank you Jugoslavfor your reply. Still the background color only effects the text which is displayed and rest of the console is still black. I found an alternative way, it might help someone.

Call SystemQQ("Color F0")

--TaZ

Antworten