delorie.com/archives/browse.cgi | search |
From: | "Pierre Beaulieu" <pbeaulie AT videotron DOT ca> |
Newsgroups: | comp.os.msdos.djgpp |
References: | <374f099e DOT 0 AT news1 DOT mweb DOT co DOT za> <FNH33.9208$Sm4 DOT 57791 AT weber DOT videotron DOT net> <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: | <XEh43.219$fr1.16344@weber.videotron.net> |
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 <kezman AT bigfoot DOT com> 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 <stdio.h> > #include <process.h> /* 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. >
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |