Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
COLTEXT.PAS
◄Example► ◄Contents► ◄Index► ◄Back►
PROGRAM coltext;
{ COLTEXT.PAS : Displays text in color }
USES
Crt, MSGraph;
VAR
message1, s, t : STRING;
Blink, fgd, bgd : Integer;
a : Integer;
BEGIN { Begin main program }
_ClearScreen( _GClearScreen );
_OutText( 'Color text attributes:' );
FOR Blink := 0 TO 1 DO
FOR bgd := 0 TO 6 DO
BEGIN
_SetBkColor( bgd );
_SetTextPosition( bgd + (Blink * 9) + 3, 1 );
_SetTextColor( 7 );
Str( bgd, s );
message1 := 'Bgd: ';
_OutText( message1 );
_OutText( s );
s := s + ' ';
message1 := ' Fgd: ';
_OutText( message1 );
FOR fgd := 0 TO 15 DO
BEGIN
_SetTextColor( fgd + (Blink*16) );
a := fgd + (Blink*16);
Str( a, s );
s := s + ' ';
_OutText( s );
END;
END; { FOR loops }
REPEAT UNTIL KeyPressed;
a := _SetVideoMode( _DefaultMode );
END.