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

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

From   "Nick Cox" <>
To   <>
Subject   st: RE: RE: RE: Double -for- loop on one line crashes Stata (resend)
Date   Tue, 15 Oct 2002 18:28:10 +0100

Nick Winter

> > ... my advice is _never_ to place any text on a line after
> > a left brace { in a loop. Always start a new
> > line.
> >
> Still and all, presumably Stata
> should at
> least respond with an error message, rather than exiting completely.
> (Behavio(u)r I just confirmed.)


> I'll note also that  -if <condition> { do something }- works and is
> commonly used in both user and Stata-written code...

Indeed, including my own programs, until recently.

But my strong impression, fuelled by comments from
Stata developers, is that Stata has to
work very hard to let you do that in your code.

Although questions of legal and illegal syntax
differ from matters of taste, I'll assert that
crunching your code into the smallest possible
space is not good style. That's a little more
than expressing one person's preferences,
as programmers discussing code do seem
to agree more closely than random on how
easy it is to read and debug, although
I have no data on which to run -kappa-...


*   For searches and help try:

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