Simple Question? Clear Screen?

Discussion in 'Mac Programming' started by Fender2112, Dec 3, 2005.

  1. macrumors 6502a

    Fender2112

    Joined:
    Aug 11, 2002
    Location:
    Charlotte, NC
    #1
    I'm using Xcode to learn C++. So far things are simple and output goes to a command window. What is the command that clears the old junk from this command window?
     
  2. macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #2
    clear .... edit: eh ... I was thinking Terminal
     
  3. Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #3
    I haven't tried it but you might try an ASCII form feed character, as that used to clear ANSI x.364 terminals.
     
  4. macrumors 6502a

    Joined:
    Jan 5, 2002
    Location:
    CA
    #4
    Try this

    I think this is what you are looking for - choose Debug -> Clear Logs

    Edit : Also, if this is what you are looking for, you can set a preference ( General -> Automatically clear logs). It will clear the command window each time you run the program.
     
  5. macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #5
    If you want to clear it manually, there's a small grey X below the vertical scroll bar.
     
  6. thread starter macrumors 6502a

    Fender2112

    Joined:
    Aug 11, 2002
    Location:
    Charlotte, NC
    #6
    Using google here's what I think I need.

    I need clscr() which in found in #include <conio.h> But this file does not exit in Xcode's version of c++

    There is also this command: system ("cls"); but this doesn't work on OS X.

    I also found this: clear. But I'm not sure of the syntax.
     
  7. macrumors member

    SamMiller0

    Joined:
    Aug 17, 2004
    Location:
    San Jose, CA
    #7
    Clearing the output in a terminal windows is platform dependent. Look at the using the ncurses library for your project.
     
  8. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #8
    Using curses ithrough Python it's
    Code:
    myWindow.clear()
    where myWindow is a curses window. You could make a window the size of the screen or
    Code:
    screen.clear()
    might also work directly, I'm not sure. Screen is automatically defined when you use curses.
     
  9. macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #9
    Well, clear is the terminal command, so system("clear"); could work.
     
  10. macrumors G3

    iMeowbot

    Joined:
    Aug 30, 2003
    #10
    Just for playing around and learning, you can use the string "\e[H\e[2J" to clear a VT100-style terminal. You're really supposed to use ncurses for that kind of thing, but that's more evil than you probably want to deal with at the start.
     

Share This Page