www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/17/09:53:36

Date: Sun, 17 Mar 1996 16:46:13 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Charles Brasted <cbrasted AT physics DOT adelaide DOT edu DOT au>
Cc: djgpp AT delorie DOT com
Subject: Re: Suggestion for FAQ and int86 question.
In-Reply-To: <9603150414.AA13892@pilot.physics.adelaide.edu.au>
Message-Id: <Pine.SUN.3.91.960317163236.16543N-100000@is>
Mime-Version: 1.0

On Fri, 15 Mar 1996, Charles Brasted wrote:

> As far as I can tell, I had let some stray spaces enter between the "set
> djgpp" and the rest, which apparently was the source of the problem.  For
> example I typed 
> set djgpp = c:\djgpp\djgpp.env
> 
> instead of 
> set djgpp=c:\djgpp\djgpp.env

Actually, the second blank (after the `=' sign) is harmless; it's the one 
*before* `=' which causes trouble, because it defines a variable called 
"DJGPP " (with the blank in the name) and thus the DJGPP startup code 
doesn't find a variable "DJGPP".

Thank you for your suggestion, I'll include such a warning in the next 
version of the FAQ.

> void pok(int x,  int y, char c)
> {
> 	goto_xy(x,y);
> 	putchar(c);
> }

It is usually bad idea to mix buffered I/O (like `putchar' or `fprintf')
with direct screen writes and BIOS interrupts.  If you *do* need to call
buffered I/O, always call `fflush(stdout)' immediately after to deliver
the characters to the screen.  But the best (and the correct) way is just
to call any of the conio functions that write directly to the screen, like
`putch' or `ScreenPutChar'.  I didn't try this, but I'd bet that in your
case, the characters aren't flushed until the program exits. 

And of course, this is also in the FAQ (section 9.4), although it doesn't 
mention `putchar' explicitly...

- Raw text -


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