Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 3, 2005, 02:26 PM   #1
Fender2112
macrumors 6502a
 
Fender2112's Avatar
 
Join Date: Aug 2002
Location: Charlotte, NC
Send a message via AIM to Fender2112
Simple Question? Clear Screen?

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?
__________________
Really? Really, really!
Fender2112 is offline   0 Reply With Quote
Old Dec 3, 2005, 02:27 PM   #2
gekko513
macrumors 601
 
gekko513's Avatar
 
Join Date: Oct 2003
clear .... edit: eh ... I was thinking Terminal
__________________
Someone get Nekkid™, now!
gekko513 is offline   0 Reply With Quote
Old Dec 3, 2005, 02:37 PM   #3
bousozoku
Moderator emeritus
 
Join Date: Jun 2002
Location: Gone but not forgotten.
I haven't tried it but you might try an ASCII form feed character, as that used to clear ANSI x.364 terminals.
bousozoku is offline   0 Reply With Quote
Old Dec 3, 2005, 02:51 PM   #4
jaykk
macrumors 6502a
 
Join Date: Jan 2002
Location: AZ
Send a message via AIM to jaykk Send a message via MSN to jaykk Send a message via Yahoo to jaykk
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.
jaykk is offline   0 Reply With Quote
Old Dec 3, 2005, 02:58 PM   #5
gekko513
macrumors 601
 
gekko513's Avatar
 
Join Date: Oct 2003
If you want to clear it manually, there's a small grey X below the vertical scroll bar.
__________________
Someone get Nekkid™, now!
gekko513 is offline   0 Reply With Quote
Old Dec 3, 2005, 03:32 PM   #6
Fender2112
Thread Starter
macrumors 6502a
 
Fender2112's Avatar
 
Join Date: Aug 2002
Location: Charlotte, NC
Send a message via AIM to Fender2112
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.
__________________
Really? Really, really!
Fender2112 is offline   0 Reply With Quote
Old Dec 5, 2005, 10:34 AM   #7
SamMiller0
macrumors member
 
Join Date: Aug 2004
Location: San Jose, CA
Clearing the output in a terminal windows is platform dependent. Look at the using the ncurses library for your project.
SamMiller0 is offline   0 Reply With Quote
Old Dec 5, 2005, 05:53 PM   #8
HiRez
macrumors 601
 
HiRez's Avatar
 
Join Date: Jan 2004
Location: 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.
HiRez is offline   0 Reply With Quote
Old Dec 6, 2005, 06:43 AM   #9
gekko513
macrumors 601
 
gekko513's Avatar
 
Join Date: Oct 2003
Quote:
Originally Posted by Fender2112
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.
__________________
Someone get Nekkid™, now!
gekko513 is offline   0 Reply With Quote
Old Dec 6, 2005, 07:18 AM   #10
iMeowbot
macrumors 601
 
iMeowbot's Avatar
 
Join Date: Aug 2003
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.
iMeowbot is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Question about Screen Sharing with Virtual Display ozthegweat Mac OS X 10.7 Lion 8 Oct 3, 2011 08:52 AM
simple question, which screen protector do you recommend kevjen888 iPad Accessories 8 Mar 27, 2011 12:02 PM
screen protectors - one simple question because I'm STUMPED cherylzyx iPhone Accessories 14 Jun 16, 2010 10:53 AM
Simple question...hopefully simple answer downingp Mac Basics and Help 6 Dec 8, 2006 10:27 PM
Simple question for a simple mind J.C. Mac Help/Tips 6 May 12, 2002 08:34 AM


All times are GMT -5. The time now is 05:44 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC