Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: Wish list: clear stata result screen


From   Daniel Lawson <dlawson1@nd.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: Wish list: clear stata result screen
Date   Mon, 8 Nov 2004 15:35:17 -0500

Rather than guessing the monitor size, how about an ado file like this?

*! version 0.1 8nov2004
program define cls
qui query
qui loc lines = c(pagesize)
if c(more) == "on" {
  qui set more off
  display _newline(`lines')
  qui set more on
}
else {
  display _newline(`lines')
}
end

Peace,
Daniel Lawson

On Nov 8, 2004, at 3:09 PM, Nick Cox wrote:

This is better than my earlier suggestion,
which please ignore.

That said, the -n(200)- here means 200 newlines.
You may have a big monitor that makes this
an optimal answer, but again it may be too high.

Nick
n.j.cox@durham.ac.uk

Dan Menes

There doesn't seem to be a "clear" command, but

display _newline(200)

is a little simpler than the loop you suggested.  Make sure
you do a "set more off" first.
Renzo Comolli

A small addition to the Stata Wish list: a command for "Clear
stata result
screen"
I think there is no such a command (I looked hard for it).

At the moment, I use an ado file I wrote (below), but for
some reason it is
slow to execute.
If any person on Statalist has any idea to make it faster, I
would greatly
appreciate.

program define cls2
        forvalues n=1/2000 {
        display ""
        local ++n
        }
end
exit
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index