Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 10th, 2005, 5:53 PM   #21
2roll4life7
Programmer
 
2roll4life7's Avatar
 
Join Date: Aug 2005
Location: 0x0010 * 0x0091 + 0x0004
Posts: 65
Rep Power: 4 2roll4life7 is on a distinguished road
Quote:
Originally Posted by tempest
There are two things that can go wrong, you can not have "clear" or not have "cls"... if you can't debug that without debugging information you've got issues as a programmer. Not to mention that this is supposed to be wrong in a terminal, so this code would be useless anywhere else...
I'm pointing out that debug messages that are written to the terminal nanoseconds before it closes are useless. Not that you need the debugging messages for this particular program. It seems you're the ones with the programming issues. I'm not trying to pick a fight here, I'm just passing on a valuable point. If you've got a chance to read Hardcore Java, the author will bring up more even more points that relate to this.
__________________
#if 0 /* in case someone actually tries to compile this */
- libpng version 1.2.8 (example.c)

<Jim_McNeat> Is there like a way to put a compiler in "Just trust me on that one" mode?
2roll4life7 is offline   Reply With Quote
Old Mar 31st, 2008, 11:23 AM   #22
dimlyBright
Newbie
 
dimlyBright's Avatar
 
Join Date: Feb 2008
Posts: 10
Rep Power: 0 dimlyBright is on a distinguished road
Re: How do I clear the screen?

Perhaps there is a way to call a new terminal to open with the remaining code while closing the old one? I have no idea how to do that... but that would guarantee a clear terminal/DOS window etc...

That is, unless
System.out.print ("\033c");
does clear all the contents of the terminal window so that even if you scrolled up you could not find the text cleared.

As far as the suggestion about the GUI, he/she is quite correct. A GUI just draws a new layer over the text and it appears to disappear. However making a GUI window of the right size, right color, centered in the computer screen, with font of the right size, right color centered in the GUI that accepts inputs and displays outputs is like five times the code you originally posted. Thus, making the GUI might be something of a pain.
dimlyBright is offline   Reply With Quote
Old Mar 31st, 2008, 11:43 AM   #23
Freaky Chris
Professional Programmer
 
Freaky Chris's Avatar
 
Join Date: Dec 2007
Location: England
Posts: 269
Rep Power: 1 Freaky Chris is on a distinguished road
Send a message via MSN to Freaky Chris
Re: How do I clear the screen?

perhaps you should check the dates on topics...
__________________
Steven Skiena - Algorithms
Freaky Chris is offline   Reply With Quote
Old Mar 31st, 2008, 7:05 PM   #24
Fall Back Son
Professional Programmer
 
Join Date: Oct 2006
Posts: 257
Rep Power: 2 Fall Back Son is on a distinguished road
Re: How do I clear the screen?

Quote:
Originally Posted by 2roll4life7 View Post
I'm pointing out that debug messages that are written to the terminal nanoseconds before it closes are useless. Not that you need the debugging messages for this particular program. It seems you're the ones with the programming issues. I'm not trying to pick a fight here, I'm just passing on a valuable point. If you've got a chance to read Hardcore Java, the author will bring up more even more points that relate to this.
I'm not trying to argue with either of you, and I don't really know that much about the issue. But it doesn't seem like that big of a deal, and if it is, there's probably a way to solve it. Such as .... make the system wait x seconds before clearing the screen if an exception was thrown beforehand.
Fall Back Son is offline   Reply With Quote
Old Apr 1st, 2008, 3:44 AM   #25
A.K.Al Shamsi
Programmer
 
A.K.Al Shamsi's Avatar
 
Join Date: Mar 2008
Posts: 35
Rep Power: 0 A.K.Al Shamsi is on a distinguished road
Re: How do I clear the screen?

you need to use
 while (true)
because it means loop forever

and you need
        if(again == 'y')
        {
            play = 1

              else
               break;
        }
         if(again == 'n')
        {
            play--;

try this it might work
A.K.Al Shamsi is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:18 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC