clearing output  
Author Message
wheelscribe





PostPosted: 2005-9-11 20:27:00 Top

java-programmer, clearing output Hello,

I've looked far and wide for the answer to this question without any
success. Is there a method in Java that clears output to
System.out.println? My goal is to pass output to the line then erase it
so that I don't have repeating lines in my loop. Any help is much
appreciated.

Thanks,
Ben
 
Gordon Beaton





PostPosted: 2005-9-11 21:17:00 Top

java-programmer >> clearing output On Sun, 11 Sep 2005 07:27:22 -0500, wheelscribe wrote:
> I've looked far and wide for the answer to this question without any
> success. Is there a method in Java that clears output to
> System.out.println? My goal is to pass output to the line then erase
> it so that I don't have repeating lines in my loop. Any help is much
> appreciated.

Most terminals let you return to the start of the line when you print
a carriage return (not a newline). You can't do this across multiple
lines though. Use System.out.print("\r") (not println()).

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
wheelscribe





PostPosted: 2005-9-11 22:13:00 Top

java-programmer >> clearing output Gordon Beaton wrote:
> On Sun, 11 Sep 2005 07:27:22 -0500, wheelscribe wrote:
>
>>I've looked far and wide for the answer to this question without any
>>success. Is there a method in Java that clears output to
>>System.out.println? My goal is to pass output to the line then erase
>>it so that I don't have repeating lines in my loop. Any help is much
>>appreciated.
>
>
> Most terminals let you return to the start of the line when you print
> a carriage return (not a newline). You can't do this across multiple
> lines though. Use System.out.print("\r") (not println()).
>
> /gordon
>


That's exactly what I needed to know. Thank you.

== Ben
 
 
Roedy Green





PostPosted: 2005-9-13 14:55:00 Top

java-programmer >> clearing output On Sun, 11 Sep 2005 07:27:22 -0500, wheelscribe
<email***@***.com> wrote or quoted :

>Is there a method in Java that clears output to
>System.out.println?

See http://mindprod.com/jgloss/console.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.