delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/04/07/17:01:05

From: "Robert B. Clark" <epynex AT 3pynexf DOT pbz>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Blinking characters
Organization: ClarkWehyr Enterprises
Message-ID: <9rh39vo18gagvepjamffi8kjidegm043h7@4ax.com>
References: <b6s6u9$bhn$1 AT saphir DOT jouy DOT inra DOT fr>
X-Newsreader: Forte Agent 1.9/32.560
MIME-Version: 1.0
Lines: 32
Date: Mon, 07 Apr 2003 13:56:57 -0500
NNTP-Posting-Host: 209.43.107.80
X-Complaints-To: news-abuse AT iquest DOT net
X-Trace: news.iquest.net 1049741206 209.43.107.80 (Mon, 07 Apr 2003 13:46:46 EST)
NNTP-Posting-Date: Mon, 07 Apr 2003 13:46:46 EST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Mon, 7 Apr 2003 15:53:45 +0000 (UTC), wajnberg AT antibes DOT inra DOT fr (Eric
Wajnberg) wrote:

>However, I just can't make the printed text to blink. The help on-line on
>textattr() (in conio.h) is not really explicit..
>
>So my question is: once I have forground and background colors, how can I
>switch to blinking mode, and switching back to steady mode?

Set the high bit of textattr()'s parameter.

For example, to get blinking white on a black background, use

	#include <conio.h>

	textattr(WHITE + (BLACK << 4) + BLINK);

conio.h should have the defines for WHITE (15), BLACK (0) and BLINK (128).

The textattr() parameter is an eight-bit mask with the following structure:

	Bit	0-3:		4-bit foreground color (0-15)
		4-6:		3-bit background color (0-7)
		7:		blink-enable bit (1=blink)

Only the first eight colors (BLACK (0) through LIGHTGRAY (7)) may be used
for background colors.


-- 
Robert B. Clark (email ROT13'ed)
Visit ClarkWehyr Enterprises On-Line at http://www.3clarks.com/ClarkWehyr/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019