Mail Archives: djgpp/1997/05/29/20:34:43
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 -