From: "Pierre Beaulieu" Newsgroups: comp.os.msdos.djgpp References: <374f099e DOT 0 AT news1 DOT mweb DOT co DOT za> <3750a551 DOT 95097825 AT news DOT pasteur DOT dialix DOT com DOT au> Subject: Re: C amateur want to know how to clear a text screen. Lines: 42 Organization: Preferred Company X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Message-ID: Date: Sun, 30 May 1999 07:45:38 -0400 NNTP-Posting-Host: 207.96.169.228 X-Complaints-To: abuse AT videotron DOT net X-Trace: weber.videotron.net 928097975 207.96.169.228 (Sun, 30 May 1999 16:59:35 EDT) NNTP-Posting-Date: Sun, 30 May 1999 16:59:35 EDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Interesting approach. Pierre Kieran Farrell wrote in message news:3750a551 DOT 95097825 AT news DOT pasteur DOT dialix DOT com DOT au... > > conio.h is in my oppinion a great header, but there is another way to > clear the screen that can be adapted into a portable version. Try > this. > > #include > #include /* Not sure if I spelled that right, oops */ > > void cls(void) > { > system( "cls" ); > return; > } > > What that basically does is ask the operating sytem to clear the > screen. As opposed to conio.h accessing the graphics card dirictly, to > make it portable, unix uses clear instead of cls. So something like > this MIGHT!!! work. > > #ifdef (WIN32) > #define cls(void) system( "cls" ) > #endif > > #ifdef (UNIX) > #define cls(void) system( "clear" ) > #endif > > Someone who knows more about compiler commands might be able to > correct me if I'm wrong there since I just made it up, but it should > work *8). > > >Try the function clrscr() from conio.h. > >> Can't find a library function to do that. >