Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Fender2112

macrumors 65816
Original poster
Aug 11, 2002
1,135
374
Charlotte, NC
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?
 

bousozoku

Moderator emeritus
Jun 25, 2002
15,675
1,840
Lard
I haven't tried it but you might try an ASCII form feed character, as that used to clear ANSI x.364 terminals.
 

jaykk

macrumors 6502a
Jan 5, 2002
854
5
CA
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.
 

gekko513

macrumors 603
Oct 16, 2003
6,301
1
If you want to clear it manually, there's a small grey X below the vertical scroll bar.
 

Fender2112

macrumors 65816
Original poster
Aug 11, 2002
1,135
374
Charlotte, NC
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.
 

HiRez

macrumors 603
Jan 6, 2004
6,250
2,576
Western US
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.
 

gekko513

macrumors 603
Oct 16, 2003
6,301
1
Fender2112 said:
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

macrumors G3
Aug 30, 2003
8,634
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.