Thread: clear the screen

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    2

    Question clear the screen

    I have what I hope is a simple question.

    How do you clear the screen so that any prior text is removed?

    I need to place this at the beginning of a function which brings up a menu of choices for the user.

    Could you be so kind as to put it in a few lines of code, for me and explain the correct usage.

    Thanks in advance

    Old Fart
    "Back to college after a LONG time."

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    There are multiple ways. Most of which are in the FAQ.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    12
    include conio.h

    then call clrscr()

    --or--

    include stdlib.h

    then call system("cls")

    or under unix

    system ("clear")
    If at first you don't succeed, punch your monitor, kick your chair, strangle your boss, and toss your computer out of the nearest window. Then, once you've relieved a portion of your frustration, try again.

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    2
    Weed4Me,

    Thank you very much, just what I needed!

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    http://www.cprogramming.com/boardfaq.html#clear

    Jesus. And to think, if you would have read the FAQ, you would have never had to even post. Exactly what you were _LOOKING_ for? I think not! If you had actually _LOOKED_ you would have found it in oh... 30 seconds.

    Quzah.

  6. #6
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Kenstemper++;
    Salemstemper+=10;
    Quzahstemper+=2000;

    Hey, a few more clear screeen posts and you'll be out of the range for a normal integer...have to bump your temper up to a float soon!

  7. #7
    Registered User
    Join Date
    Nov 2001
    Posts
    12

    As usual..

    Every message board I have ever subscribed to has always had two types of people.

    The first type usually only comes around when they have a question or a problem. They understand what its like to have a sincere problem, and they usually help others whenever they come across something they already have knowledge of.

    The second kind seems to stay on the message board 24/7 and derive some form of perverse pleasure out of bashing, insulting, criticizing, and condeming the first type. They also rarely answer any question straightforwardly or politely, instead, they make derrogatory remarks and sometimes post links to requested information along with their rude content, if the individual in question is lucky.

    From what I've learned, all anyone can do is just ask their question and hope that some decent and intelligent person will post an informative response in the midst of their being belittled by the less than friendly members of the site.

    Tell me, is all of this necessary?
    If at first you don't succeed, punch your monitor, kick your chair, strangle your boss, and toss your computer out of the nearest window. Then, once you've relieved a portion of your frustration, try again.

  8. #8
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    > Tell me, is all of this necessary?

    Yes, it is. How about you hang around here every day, and every day, answer how to clear the screen.

    Furthermore, you missed the 3rd type of person:

    The type of person who hangs around all day, answering questions for people that actually put forth some effort, and yelling at the people who make absolutely no attempt at anything for themselves. That's me.

    Quzah.
    Hope is the first step on the road to disappointment.

  9. #9
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    > Tell me, is all of this necessary?

    Nope, but it would have been avoided by a quick jaunt to the FAQ (y'know, like the page says you're supposed to). If the question wasn't one that had been answered 7 billion times before, there wouldn't be mad people.

    > include stdlib.h
    > then call system("cls")

    Visit the FAQ yourself to read why this is a bad idea.

  10. #10
    Unregistered
    Guest
    I apologize for causing this 'controversy'

    Thantos made it clear what I should have done.

    So I was told. And once is usually good enough for me.

    The other remarks were clearly not necessary and redundant. Just like 'bad code'.

    You had a choice. You could have let it go. But no, you decided you had to get your two cents in.

    Furthermore, I too am members of many other boards(on other topics). And have found that it is useless to continue to gripe over newbies. After all if they were not here, what would you people who have nothing better to do than come to the board and "hang around here every day, and every day" do? How many of your 224 messages are nothing more than b-tching and moaning?

    Try an anger management class.

    But if it makes you feel better, I am glad to have helped.
    You are welcome.

  11. #11
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    > I apologize for causing this 'controversy'

    Uh huh.

    > Thantos made it clear what I should have done.

    OIC.

    > So I was told. And once is usually good enough for me.

    But this time it wasn't quite good enough? If it was, then why did
    you follow up shortly there after with a "Oh, this is just what I needed!" ... the first post told you what you needed.

    Additionally, as for how many of my posts are ........ing and moaning, had you actually bothered to READ any of the other posts on the same page, you'd have seen numerous posts on how to clear the screen.

    The fact is, you didn't want to have to do any research, or any of the simplest tasks, you just wanted to have the "work" handed to you.

    This is the reason people get ........ed off. Lazy people like you show up, ask the same exact question that's been asked earlier on the same page, and then complain when they aren't helped.

    Trust me on this one. People show up, post a message, and then start replying to their own message five minutes later, yelling and screaming, because no one has replied or given them the answer.

    And people wonder why we're so cheery. No one gets paid to hand out answers here. They do it because they like some aspect of it. I actually enjoy helping people who give it an effort. I do not enjoy 'helping' people who are to stupid or lazy to try it themselves.

    Quzah.
    Hope is the first step on the road to disappointment.

  12. #12
    Unregistered
    Guest
    Quzah wrote

    "But this time it wasn't quite good enough? If it was, then why did you follow up shortly there after with a "Oh, this is just what I needed!" ... the first post told you what you needed"


    Because I was THANKING a junior member (Weed4Me) for taking the time to answer my seeingly stupid question without the need to assault me.

    By the way, I am done with this thread and this board. You are obviously the 'type' of person who has an opinion on everything. And furthermore, must have the last word.

    Well here is your opportunity.

    If the other members here are anywhere as accomodating as you, I will go somewhere else.

    Just try to remember back to a time when you did not know it all. You probably think there was never such a time.

  13. #13
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Exxxxcellent,

    Another satisfied customer.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  14. #14
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Just so you know I wasn't trying to start anything. I made reference to the FAQ because I have read it and know that it explains the different approaches a lot better then I could.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CLear Screen Routine
    By AQWst in forum C++ Programming
    Replies: 4
    Last Post: 12-13-2004, 08:24 PM
  2. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  3. Getting a clear screen...
    By Finchie_88 in forum C++ Programming
    Replies: 13
    Last Post: 09-03-2004, 05:38 PM
  4. Clear Screen Again!!!
    By trang in forum C Programming
    Replies: 3
    Last Post: 12-13-2003, 08:36 AM
  5. Yet another clear screen thread :D
    By kermit in forum Linux Programming
    Replies: 2
    Last Post: 11-20-2003, 05:14 AM