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

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


From   Kaleb Michaud <[email protected]>
To   [email protected]
Subject   st: Double -for- loop on one line crashes Stata (resend)
Date   Tue, 15 Oct 2002 11:27:25 -0500

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




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