Intel® Fortran Compiler 16.0 User and Reference Guide

SETTEXTCOLOR (W*S)

Graphics Function: Sets the current text color index.

Module

USE IFQWIN

result = SETTEXTCOLOR (index)

index

(Input) INTEGER(2). Color index to set the text color to.

Results

The result type is INTEGER(2). The result is the previous text color index.

SETTEXTCOLOR sets the current text color index. The default value is 15, which is associated with white unless the user remaps the palette. GETTEXTCOLOR returns the text color index set by SETTEXTCOLOR. SETTEXTCOLOR affects text output with OUTTEXT, WRITE, and PRINT.

The background color index is set with SETBKCOLOR and returned with GETBKCOLOR. The color index of graphics over the background color is set with SETCOLOR and returned with GETCOLOR. These non-RGB color functions use color indexes, not true color values, and limit the user to colors in the palette, at most 256. To access all system colors, use SETTEXTCOLORRGB, SETBKCOLORRGB, and SETCOLORRGB.

Note

The SETTEXTCOLOR routine described here is a QuickWin routine. If you are trying to use the Microsoft* Platform SDK version of the SetTextColor routine by including the IFWIN module, you need to specify the routine name as MSFWIN$SetTextColor.

Example

 ! Build as a Graphics ap.
 USE IFQWIN
 INTEGER(2) oldtc
 oldtc = SETTEXTCOLOR(INT2(2)) ! green
 WRITE(*,*) "hello, world"
 END

See Also