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

st: RE: SV: RE: 'outreg' in a 'foreach' - loop: Thanks


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: SV: RE: 'outreg' in a 'foreach' - loop: Thanks
Date   Wed, 9 Jun 2004 16:03:15 +0100

Note that my wording is not precise enough
to describe my code. 

The local macro, in my code, is not set to 
"append" before the end of the first loop. 
It is _also_ set at the end of the second 
and subsequent loops, an overhead which 
is guessed to be trivial. 

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

Kim Lyngby Mikkelsen (KLM)
 
> Dear Nick, Richard, and Benn
> 
> Nick and Benn basically had the same idea, and it worked just fine.
> Thank you all.
> Regards Kim
> 
> -----Oprindelig meddelelse-----
> Fra: Nick Cox [mailto:n.j.cox@durham.ac.uk] 
> Sendt: 9. juni 2004 14:10
> Til: statalist@hsphsun2.harvard.edu
> Emne: st: RE: 'outreg' in a 'foreach' - loop
> 
> 
> Try something like this 
> 
> foreach ... { 
> 
> 	outreg  ... `append' 
> 
> 	local append "append" 
> } 
> 
> i.e. a local macro is set only at the end
> of the first loop. 
> 
> Nick 
> n.j.cox@durham.ac.uk 
> 
> > -----Original Message-----
> > From: owner-statalist@hsphsun2.harvard.edu
> > [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of 
> Kim Lyngby 
> > Mikkelsen (KLM)
> > 
> > I wont to use 'outreg' in a 'foreach'-loop, but to do that I
> > need 'outreg' to ignore the "append"-option the first time it 
> > is called, as the output file does not yet exist.
> > 
> > How do I make 'outreg' to do that, or is there another way to
> > come around this problem?

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