Solved

Clearing a Screen

Posted on 1998-12-13
7
434 Views
Last Modified: 2009-07-29
Hi,
I'm just beginning to learn C++ this year (since September) in a course being taught at my school.  We use Metrowerks Codewarrior for our compiler and WinSioux.  For a couple of programs I've been writing, a clear screen function would have been most helpful.
I was wondering if there was a standard class that was not included in my version of CodeWarrior, or some simple code that I could use, or just a good class that someone's used.
Thanks.
0
Comment
Question by:croakDog
7 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1180048
C++ is hardware independant, so standard C++ does not  contain procedures or classes for dealing with the screen or printers etc.  However, almost every version of C++ sold contains additonal libraries/files for interfacing with the operating system,  These may include, features for dealing with the screen or for calling operating system procedure for doing so.  However, as I said, this is not standard C++, so such features are not necessarily protable and will depend greatly, on the compiler and operating system you are using.

I am not familiar with codewarrior, is it producing a DOS program?  if so there probably is a feature calling DOS services (some of which deal with the screen).
0
 
LVL 1

Expert Comment

by:The_Brain
ID: 1180049
I would think that clearscreen was a route command in C++.  now I will have to look it up.  I will be back with an answer or maybe not.  If I can't find anything, then I will write a header file which you could include in your projects.  Would you like that header file?
0
 

Expert Comment

by:Mithander
ID: 1180050
nietod,
I belive codewarrior is for mac.

croakDog,
I'm not familiar with codewarrior, but one approach is to print several blank lines.  I'm sure this isn't what you want, but it's a temp fix.  Also, try looking in the help file for a command to move the cursor on the screen.  If you can do that then normally you can format the text so you don't have to clear the screen.  Sorry I can't be of more help

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

by:nietod
ID: 1180051
If I remember correctly, Borland C for the Mac included GotoXY(), ClrScreen(), and ClrToEol().  You might want to look for those.
0
 
LVL 1

Expert Comment

by:The_Brain
ID: 1180052
Then again, for mac, Sorry no experience with mac at all.  
0
 
LVL 1

Expert Comment

by:cph
ID: 1180053
on Borland C++, you have clrscr(); to clear a screen. You have to include the conio.h header file. You can try it out...

CpH
0
 

Accepted Solution

by:
midnitelite earned 100 total points
ID: 1180054
This is clearly not the best solution:

for (int i = 1; i <= 25; i++)
    cout << endl;
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
TTimer no longer functioning 7 85
Handle Exceptions during instantiation 28 411
convert char array to number in c 5 83
Installshield for Embarcadero EX 10.1 Berlin 4 20
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now