The same analogy, use the DOS command, "cls"
#if defined (LINUX)
rv = system("clear");
#elif degined (WINDOWS)
rv = system("cls");
#endif
There is also a Windows API that he can use, but this works in a terminal
window.
On 7 Feb 2002 at 14:15, R. Sean Hartnett wrote:
> Thanks Jerry for the response. Though I have been doing some of the
> writing of the program on both Linux and Windows, I need the clear
> screen to work on Windows. This program is for someone else.
>
> Thanks again,
> Sean
>
> On Wed, 2002-02-06 at 22:44, Jerry Feldman wrote:
> > The simplest (but not really efficient) way is simply to issue the Unix
> > clear command using the C system(3) function. This is portable because all
> > Unix and Unix derivatives support this command, and the system(3) function
> > is part of standard C language, and available in C++.
> > int rv;
> > rv = system("clear");
> > if (rv != 0) {
> > // error processing if desired
> > }
> >
> > There are better ways, such as using the appropriate codes for clearing the
> > screen. (I don't have the codes at my fingertips), or a more portable way
> > is to use curses(3).
> > "R. Sean Hartnett" wrote:
> > > I am writing a program that does conversions in a terminal window. After
> > > the user chooses what he wants to do I have the program ask the user if
> > > he wants to continue with more conversions, and if the answer is yes it
> > > brings up the menu screen that was present at startup. However it does
> > > not display it as if the program was just started, it just rolls the
> > > view a bit and places the main menu after it.
> > > Is there some method that can be used to force a clean screen and the
> > > main menu would be displayed as if the program had just been started?
> > >
> > > Thanks
> > > Sean
> > >
> > >
> > >
> > >
> > > *****************************************************************
> > > To unsubscribe from this list, send mail to [EMAIL PROTECTED]
> > > with the text 'unsubscribe gnhlug' in the message body.
> > > *****************************************************************
> > >
> >
> > --
> > Jerry Feldman <[EMAIL PROTECTED]>
> > Boston Linux and Unix user group
> > http://www.blu.org PGP key id:C5061EA9
> > PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
> >
> >
>
>
>
> *****************************************************************
> To unsubscribe from this list, send mail to [EMAIL PROTECTED]
> with the text 'unsubscribe gnhlug' in the message body.
> *****************************************************************
--
Jerry Feldman
Portfolio Partner Engineering
508-467-4315 http://www.testdrive.compaq.com/linux/
Compaq Computer Corp.
200 Forest Street MRO1-3/F1
Marlboro, Ma. 01752
*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************