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

Re: st: Re: Clear the Results Window


From   Tom Trikalinos <[email protected]>
To   [email protected]
Subject   Re: st: Re: Clear the Results Window
Date   Mon, 5 Dec 2005 17:45:52 +0200

Indeed! I won't be so hasty to post code next time.
Thanks, Nick

tom

It won't bite in practice, but the line

qui query

does nothing useful here. Almost all of the
work here is done by the single line

. di _newline(`=c(pagesize)')

although that's not easy to remember or type.

Nick
[email protected]

Tom Trikalinos

I generally agree with David's view. Nevertheless, some people -me
counting amongst them- would like to "clear" the results window from
time to time; depends on the mood.
We know it's meaningless, but we do like to do it.

Mingfu would probably like to see the following program. It's
essentially a copy-paste of a code snippet posted by another
stata list
member whose name -I regret to admit- I fail to recall.

save it as cls.ado along the adopath, and you're set.


*! version 0.1 5Dec2005
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




On Dec 4, 2005, at 8:33 PM, Svend Juul wrote:

Mingfu Liu asked:
... I would like to clear up the content in the
"results window" in the middle of a Stata session.
How do I do it?

and David answered:
"Why would you want to do that?!"
---------------------------------------------------

I guess that you want to be able to modify the output,
e.g. by removing junk, before printing. That can not
be done in the Results window; but you can use a log
file. I made this simple profile.do and put it in
c:\ado\personal:

   log using c:\stata.log , replace

profile.do is executed whenever you open Stata, and you
then have a copy of the output (text mode). If you open
stata.log in a text editor, you can edit it, remove junk,
etc. before printing. As text editor I use NoteTab Light,
(download for free from www.notetab.com), but there are
many other possibilities. Find a destription by:
   findit text editor

Also read -[R] log- and -[GSW] 16- (or your appropriate
Getting Started manual), or:
   help log

My suggestion above is to open a log file automatically
at session start, but you will meet other opinions on
how to use log files.

*
*   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/


Tom Trikalinos, MD
[email protected]

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index