delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/05/09:19:45

Date: Sun, 5 May 1996 21:07:02 -0800 (GMT)
From: "Rafael R. Sevilla" <rsevilla AT upd DOT edu DOT ph>
To: DJGPP Mail Server <djgpp AT delorie DOT com>
Subject: Screen updates with \b
Message-ID: <Pine.SOL.3.91.960505205409.13837B-100000@sauron>
MIME-Version: 1.0

I've been writing a few Turbo C programs in the past and have attempted to
port them to djgpp and have had a few problems here and there. But there
is yet another problem which mystifies me greatly. I avoided use of the
conio.h functions in Turbo C because they weren't portable, and to update
things like status displays on a single line, I repeatedly printed the
backspace character (ASCII 8, or "\b") to standard output until I get back
to the start of the output line and then printed the update. This works
properly with Turbo C under DOS and GCC 2.7.2 under Solaris 5.3, but not
under djgpp. What djgpp does is wait until the _last_ such update before
printing anything! Why? An example of this usage follows:

printf("Line: ");
for (i=0; i<n; i++) {
	sprintf(bufr, "%d", i);
	len = strlen(bufr);
	printf("%s", bufr);
	/* further processing */
	for (j=0; j<len; j++)		/* erase */
		printf("\b");
}

-------------------------------------------------------------------------
University of the Philippines                           Rafael R. Sevilla
PABX/OVCA: Diliman Networking Project          rsevilla AT sauron DOT upd DOT edu DOT ph
-------------------------------------------------------------------------

- Raw text -


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