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

st: Viewer windows


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Viewer windows
Date   Wed, 4 May 2005 21:55:21 +0100

After a while, evidently, several Stata 9 
users often find viewer windows proliferating like
rabbits. 

What do you do about rabbits? 

1. Keep the population down (the Wolfe solution)
================================================

Use the -nonew- option, directly or indirectly. 

2. Shoo them away one by one (the mouse solution) 
================================================= 

Click and shut. Gentle but possibly tedious. 

3. Shut them in batches
=======================

. window manage close viewer _all 

will, for example, will close them all. Clearly, 
you won't want to type that interactively, so 
a wrapper is indicated. 

. vclose

shuts all viewer windows, while a numlist is 
allowed, so that  

. vclose 1/4 

shuts #1 #2 #3 #4, and if you wish 

. vclose "#32" 

shuts #32. 

Not tested much, but here it is: 

*! NJC 1.0.0 9 May 2005 
program vclose
	version 9 
	syntax [anything] 

	if inlist("`anything'", "", "_all") { 
		window manage close viewer _all
	}
	else { 
		capture numlist "`anything'" 

		if _rc == 0 { 
			foreach v in `r(numlist)' { 
				window manage close viewer "#`v'"
			}
		}
		
		else foreach v in `anything' { 
			window manage close viewer `v' 
		}	
	}
end 

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

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