PDA

View Full Version : Simple Question? Clear Screen?




Fender2112
Dec 3, 2005, 02:26 PM
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?



gekko513
Dec 3, 2005, 02:27 PM
clear .... edit: eh ... I was thinking Terminal

bousozoku
Dec 3, 2005, 02:37 PM
I haven't tried it but you might try an ASCII form feed character, as that used to clear ANSI x.364 terminals.

jaykk
Dec 3, 2005, 02:51 PM
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.

gekko513
Dec 3, 2005, 02:58 PM
If you want to clear it manually, there's a small grey X below the vertical scroll bar.

Fender2112
Dec 3, 2005, 03:32 PM
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.

SamMiller0
Dec 5, 2005, 10:34 AM
Clearing the output in a terminal windows is platform dependent. Look at the using the ncurses library for your project.

HiRez
Dec 5, 2005, 05:53 PM
Using curses ithrough Python it'smyWindow.clear()where myWindow is a curses window. You could make a window the size of the screen orscreen.clear() might also work directly, I'm not sure. Screen is automatically defined when you use curses.

gekko513
Dec 6, 2005, 06:43 AM
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.
Well, clear is the terminal command, so system("clear"); could work.

iMeowbot
Dec 6, 2005, 07:18 AM
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.