clrscr(); not clearing the screen

This is a discussion on clrscr(); not clearing the screen within the C Programming forums, part of the General Programming Boards category; lets say u write some program which counts to 1000 and spams 1000 lines. then it ends. then u start ...

  1. #1
    1.b4 e5 2.a3 d5 3.d4 exd
    Join Date
    Jan 2003
    Posts
    167

    clrscr(); not clearing the screen

    lets say u write some program which counts to 1000 and spams 1000 lines. then it ends. then u start a new program which does clrscr(); well, on my computer, when it does this clrscr(); it only clears the top half of the command prompt window-leaving the spam visible in the bottom half
    AIM: MarderIII

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    32
    I don't understand really your message, you say you run a program in console, then this program prints some line in the console, then you call another program witch contains clrscr(); but it doesn't clear the screen? well, did you try others options, check out the FAQ, and see "Clearing the screen" session.

  3. #3
    1.b4 e5 2.a3 d5 3.d4 exd
    Join Date
    Jan 2003
    Posts
    167
    Windows xp professional
    borland c++ 5.02

    Code:
    clrscr();
    its like even tho I have my command prompt screen set so large that I spam

    C:\
    C:\
    C:\
    C:\
    C:\
    C:\
    C:\
    but when i clrscr it only clears the top half
    AIM: MarderIII

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by Noobie
    its like even tho I have my command prompt screen set so large that I spam
    Welcome to the wonderful world of implementation specifics. I suspect that your clrscr function just clears an area 80x25. If your command prompt is larger, it doesn't work. Furthermore, you're on a WinXP machine, and you're running a DOS program. The command prompt for WinXP is not DOS.

    There are two command prompts in XP. 'cmd' and 'command'. They behave differently. Neither one of them is true DOS.

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

  5. #5
    1.b4 e5 2.a3 d5 3.d4 exd
    Join Date
    Jan 2003
    Posts
    167
    so is there no way to clear it? That hardly makes it seem like XP is some kind of upgrade.
    AIM: MarderIII

  6. #6
    Registered User
    Join Date
    Apr 2003
    Posts
    32
    Noobie, can you try system("CLS"); and tell me if it works? Maybe it'll work for you.

  7. #7
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by Noobie
    so is there no way to clear it? That hardly makes it seem like XP is some kind of upgrade.
    The problem is that you are using a DOS compiler to run a DOS program on a NON-DOS operating system. You cannot expect non-ANSI code to behave the same from one OS to another. It has nothing to do with XP not being a good enough upgrade. It has to do with you compiling non-ANSI code on an entirely different OS.

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

  8. #8
    1.b4 e5 2.a3 d5 3.d4 exd
    Join Date
    Jan 2003
    Posts
    167
    Yes,

    system("CLS");

    works


    If I run this command on, say, Win 95, is it going to have a problem?
    AIM: MarderIII

  9. #9
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by Noobie
    Yes,

    system("CLS");

    works

    If I run this command on, say, Win 95, is it going to have a problem?
    Not on Win95. But also read this .
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Clearing the screen
    By cromologic in forum C Programming
    Replies: 2
    Last Post: 04-27-2006, 05:59 AM
  2. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 03:56 PM
  3. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 09:18 PM
  4. clearing the screen
    By ssharish in forum C Programming
    Replies: 2
    Last Post: 02-01-2005, 08:00 PM
  5. 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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21