Date: Sun, 2 May 1999 14:59:42 -0400 Message-Id: <199905021859.OAA31550@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: <004901be94cb$5c14ede0$c5275da6@siegfried> (john_meyer AT geocities DOT com) Subject: Re: How to clear the screen in MS-DOS? References: <372beee0 DOT 3164117 AT netnews DOT worldnet DOT att DOT net> <199905021832 DOT OAA13903 AT envy DOT delorie DOT com> <004901be94cb$5c14ede0$c5275da6 AT siegfried> Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Why, DJ, you're advocating non-ISO standard C++. How could you! > > > I've been reading too much of comp.lang.c++ There is no way of doing device-specific things in a portable way. clrscr() is in both djgpp and borland and always works in djgpp. You could print "\033[0;0H\033[2J" but that only works if ANSI.SYS is installed, and won't work under Unix for non-ansi terminals. You could use __dpmi_int() to do the BIOS interrupt to reinit the current mode, but that's djgpp-specific. The best you can hope for for portability is to uses curses or termcap, assuming you can determine what parts of curses/termcap work the same way on all platforms (and can *find* curses/termcap for all platforms). As for standards, use them when you can but don't be blind to non-standard solutions when they make sense.