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

st: indents in smcl output


From   David Airey <david.airey@vanderbilt.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: indents in smcl output
Date   Mon, 23 Feb 2004 23:24:55 -0600

I was wondering if anyone else was bothered by smcl formating when your .do code has blank lines inserted inside a loop?

For instance, here is a snippet of code:

---
levels region, local(levels)
foreach l of local levels {
preserve
keep if region == "`l'"

quietly table `A' `B'
local N = r(N)

egen tag = tag(`A')
egen sum = sum(tag)
local p = sum[1]
drop sum tag
---

and here is the output:

---
. levels region, local(levels)
`"a"' `"b"' `"f"' `"h"' `"l"' `"n"' `"s"' `"v"'

. foreach l of local levels {
2. preserve
3. keep if region == "`l'"
4.
. quietly table `A' `B'
5. local N = r(N)
6.
. egen tag = tag(`A')
7. egen sum = sum(tag)
8. local p = sum[1]
9. drop sum tag
---

I don't like how the blank lines are numbered and the next line is given the "." To me, this seems better:

---
. foreach l of local levels {
2. preserve
3. keep if region == "`l'"
.
4. quietly table `A' `B'
5. local N = r(N)
.
6. egen tag = tag(`A')
7. egen sum = sum(tag)
8. local p = sum[1]
9. drop sum tag
---

Why is the way it is preferred?

-Dave

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index