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

st: RE: Double -for- loop on one line crashes Stata (resend)


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Double -for- loop on one line crashes Stata (resend)
Date   Tue, 15 Oct 2002 17:26:54 +0100

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

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of 
> Kaleb Michaud
> Sent: 15 October 2002 17:27
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Double -for- loop on one line crashes Stata (resend)
> 
> 
> (sent this yesterday, but still haven't received it back so 
> trying one more 
> time)
> 
> Just an FYI - seems the more I use Stata, the more I'm 
> compressing my 
> code.  The following, independent of the actual command 
> used, crashes my 
> Stata every time (using Stata 7.0SE in Win2000 - causes 
> Stata to end, no 
> error message in results).
> 
> Feel free to tell me why so I don't assume such things will 
> work in the 
> future, but thought I'd share.
> 
> Kaleb...
> 
> 
> forvalues i =1/3 {forvalues j=1/3 {replace badcode = 
> badcode + "h`i'_`j'" 
> if hrec`i'_`j'chk>0 } }
> 
> I do know it works for one loop on one line, and this also 
> works fine in a 
> do file written as:
> 
> forvalues i =1/3 {
> 	forvalues j=1/3 {
> 		replace badcode = badcode + "h`i'_`j'" if 
> hrec`i'_`j'chk>0
> 	}
> }
> 
> *
> *   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