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

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


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: RE: Double -for- loop on one line crashes Stata
Date   Tue, 15 Oct 2002 19:58:22 +0100

Kaleb Michaud
> 
> This is what I was curious about.  All of the discussion on 
> syntax/style is 
> fine - I think you'd find my code to be written as you 
> prefer - it was just 
> a strange occurrence as I often will enter these loops in 
> the command line 
> manually and I never thought it was a problem.
> Why should something like:
> 
> if `n' > 0 {di "This"...}
> 
> not be safe/smart in one line?  Just curious if I should 
> change the way I code.

Well, we really need a Stata Corp input on this one. 

Loosely, the more strain you put on the parser,  
the greater the risk that Stata will misunderstand, 
but that's just rephrasing my earlier comment 
without adding any substance. 

Stata sometimes to behave as if braces were another 
kind of end-of-line delimiter, but not always. 

Also, although the above works fine, I think you'll 
see, if you look at documentation, that it is not encouraged
anywhere, even by example. 
 
Nick 
[email protected] 

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