delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/29/20:34:43

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: window() function doens't work?
Date: Thu, 29 May 1997 15:45:07 -0400
Organization: Cornell University http://www.cornell.edu
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <338DDCC3.17EA@cornell.edu>
References: <338db567 DOT 1153765 AT news DOT prestel DOT co DOT uk>
Reply-To: asu1 AT cornell DOT edu
NNTP-Posting-Host: cu-dialup-0034.cit.cornell.edu
Mime-Version: 1.0
Lines: 45
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Luke Steele wrote:
> I'm having some problems with the window() function.  When I define a
> window, only the first line of text within it appears within the
> window's x limits -- subsequent lines of text appear at the far left
> of the screen as if the window function hadn't been called.  Any ideas
> as to the problem?

i do not really understand what your problem is ... a couple of lines to
illustrate the problem would have been nice. that said, take a look at
the following, maybe it will help:

#include <conio.h>

int main(void)
{
 clrscr();
 window(5,5,40,10);
 cputs("this is some simple test string to be printed.\n\r");
 cputs("this is another simple test string to be printed.\n\r");
 getch();

 textbackground(BLUE);
 clrscr();
 cputs("and if the amount of text overflows the window boundaries, ");
 cputs("it will automatically scroll.\n\r");
 getch();

 cputs("\n\n\n\n\n\rThere you go...");
 return 0;
}

on second thought, it is probably because you terminate the strings with
\n only rather than \n\r ... i am not sure why the conio functions were
implemented this way, but i have gotten used to it.
-- 
   Sinan
 
*******************************************************************
 A. Sinan Unur                                WWWWWW
                                              |--O+O
 mailto:sinan DOT unur AT cornell DOT edu                C   ^ 
 http://www.people.cornell.edu/pages/asu1/     \  ~/ 

Unsolicited e-mail is _not_ welcome, and will be billed for.
*******************************************************************

- Raw text -


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