James Jetton
>
> Nested for loops often fail if the ids are not explicitly
> specified.
> For example
>
> for any a b c: for num 1984/2000:
>
> will fail but
>
> for X in any a b c: for Y in num 1984/2000:
>
> will work.
>
> This appears to be a bug in the for ado. Been bitten by this
> hemipteran more than once.
>
The bug here, I suggest, is in documentation
which suggests (or implies) that nested -for-s
will necessarily work.
The on-line help for -for- is one example.
The sad fact is that sometimes they will,
and sometimes they won't, for reasons
best explained by Alan Riley and Bobby Gutierrez
in a Statalist posting on 15 October.
The only general advice is to avoid nested
-for- in favour of -forval- and/or -foreach-.
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/