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


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:

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